Ember Starter

by machty

HTML

<script src="http://cloud.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">
    {{outlet}}
</script>

<script type="text/x-handlebars" data-template-name="hello">
    Hello world.
    {{outlet}}
</script>

CoffeeScript

window.App = Em.Application.create
  autoinit: false
        
App.ApplicationController = Em.Controller.extend()
App.ApplicationView = Em.View.extend
  templateName: "application"

App.HelloController = Em.Controller.extend()
App.HelloView = Em.View.extend
  templateName: "hello"
 
App.Router = Em.Router.extend
  enableLogging: true
  location: 'none'
  root: Em.Route.extend
    index: Em.Route.extend
      route: '/'
      connectOutlets: (router) ->
        router.get('applicationController').connectOutlet
          viewClass: App.HelloView
        
$ ->
  window.App.initialize()