I’ve been following through the tutorial / guide published here: http://www.adobe.com/devnet/html5/articles/flame-on-a-beginners-guide-to-emberjs.html
Which has been a great help at getting me started with Ember.js, however, I have found that whilst the code in his examples work with Ember.js version 0.9.6, they do not work with the 1.0 pre version. My handlebars code that should generate a list item for each item in the App.labelController just does nothing when using the newer version. Is this an intentional change? If so, how do I go about achieving the same effect now?
EDIT: I’ve actually narrowed down the breaking change to between version 0.9.7.1 and 0.9.8
I have the following code (for reference):
/**************************
* Application
**************************/
// Create the Ember.js application framework
App = Em.Application.create();
/**************************
* Models
**************************/
// The "model" for the label object
App.Label = Em.Object.extend({
id: null,
name: null,
svg: null
});
/**************************
* Views
**************************/
/**************************
* Controllers
**************************/
// The "controller" for the label objects
App.labelController = Em.ArrayController.create({
content: [],
init: function() {
// Fake some data arriving from the server
for (var i = 0; i < 10; i++)
{
var label = App.Label.create({
id: i,
name: 'Label 0' + i,
svg: null
});
this.pushObject(label);
}
}
});
And the following HTML:
<div class="row-fluid">
<div class="span3">
<ul class="nav nav-list">
<script type="text/x-handlebars">
{{#each App.labelController}}
<li>
<a href="#">{{name}}</a>
</li>
{{/each}}
</script>
</ul>
</div>
<div class="span9" id="drawContainer">
</div>
</div>
You forgot to call
this._super()on theApp.labelController#initmethod.Here is your JSFiddle: it does not work.
And the JSFiddle with the call to
_super: it works.