Reputation: 9644
I'm just going through the Emberjs tutorial on http://trek.github.com/, but parts of the code is not returning the expected output.
My HTML is
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-rc.1.min.js"></script>
<script type="text/javascript" src="js/App.js"></script>
</head>
<body>
<div></div>
<script type="text/x-handlebars" data-template-name="application">
<h1>Ember committers</h1>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="contributors">
{{#each person in controller}}
{{person.login}}
{{/each}}
</script>
</body>
</html>
My App.js (written in App.coffee)
window.App = Ember.Application.create()
App.ApplicationView = Ember.View.extend
templateName:"application"
App.ApplicationController = Ember.Controller.extend()
App.AllContributorsController = Ember.ArrayController.extend()
App.AllControbutorsView = Ember.View.extend
templateName:"contributors"
App.Router = Ember.Router.extend
root:Ember.Route.extend
index:Ember.Route.extend
route:"/"
connectOutlets: (router) ->
router.get("applicationController").connectOutlet("allContributors", [{login:'wycats'},{login:'tomdale'}])
I expect the "wycats" and "tomdale" to be printed out, but there's nothing. Here's my jsFiddle - http://jsfiddle.net/Djunu/
Upvotes: 1
Views: 134
Reputation: 1134
Your code is based on an outdated API. Ember 1.0.rc has a completely new and much friendler way of defining routes and setting up controllers. Refer to this guide for up-to-date material: http://emberjs.com/guides/routing/
Upvotes: 1