Ember.js Controller Does Not Work
I can't access to my array controller variables. I have this simple application for example: App.js App = Ember.Application.create(); App.ApplicationAdapter = DS.FixtureAdapter.e
Solution 1:
The problem is you're changing the context in your each statement to the model, so you no longer have the name in context.
http://emberjs.jsbin.com/UzUxIwa/1/edit
<script type="text/x-handlebars" data-template-name="hello">
{{#each item in controller}}
{{item.title}} {{controller.name}}
{{/each}}
</script>
Honestly even better than this would be to use an itemController and put the property on that controller
http://emberjs.jsbin.com/UzUxIwa/2/edit
App.HelloController = Ember.ArrayController.extend({
itemController:'singleHello'
});
App.SingleHelloController = Ember.ObjectController.extend({
name: 'tom'
});
{{#each item in controller}}
{{item.title}} {{item.name}}</br>
{{/each}}
Post a Comment for "Ember.js Controller Does Not Work"