JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.js"></script>
<script type="text/x-handlebars" data-template-name="application">
<header>
<h1>Ember Router Sample</h1>
</header>
{{outlet}}
<footer></footer>
</script>
<script type="text/x-handlebars" data-template-name="home">
<p>Hello World !</p>
</script>
CSS
header h1 {
width: 100%; height: 40px; line-height: 40px; text-align: center;
}
header nav {
width: 100%; text-align: center;
}
header nav a {
color: #008Bff; cursor: pointer;
}
p {
padding: 20px;
}
JavaScript
var Sylvius = Ember.Application.create({
ready: function() {
return this.initialize();
}
});
Sylvius.ApplicationController = Em.Controller.extend();
Sylvius.ApplicationView = Em.View.extend({
templateName: 'application'
});
// For the "atlas launcher" box on the home page and the panel
Sylvius.HomeController = Em.ArrayController.extend();
Sylvius.HomeView = Em.View.extend({
templateName: 'home'
});
Sylvius.Router = Em.Router.extend({
enableLogging: true,
// location: 'hash',
root: Em.Route.extend({
// STATES
index: Em.Route.extend({
route: '/',
connectOutlets: function(router, context) {
router.get('applicationController').connectOutlet({
viewClass: Sylvius.HomeView,
controller: Sylvius.HomeController
});
}
})
})
});