Ember 0.9.8.1 Template with ember-data
HTML
<script src="https://github.com/downloads/emberjs/ember.js/ember-0.9.8.1.js"></script>
<script src="https://github.com/downloads/pjmorse/ember-skeleton/ember-data.min.js"></script>
<script type="text/x-handlebars">
<h1>Sections</h1>
<ul>
{{#each App.TodoContoller.content}}
<li>Section: {{title}}</li>
{{/each}}
</ul>
</script>
CSS
* { font-family: helvetica; }
body { padding: 20px; }
h1 { font-weight: bold; font-size: 1.2em; }
JavaScript
App = Ember.Application.create();
App.ApplicationAdapter = DS.FixtureAdapter.extend();
App.Router.map(function() {
this.resource("todo");
});
App.Thing = DS.Model.extend({
title: DS.attr('string'),
description: DS.attr('string')
});
App.Thing.FIXTURES = [
{
id: 1,
title: 'Fixiture1',
description:'Description'
},
{
id: 2,
title: 'Fixiture2',
description:'Description'
}
];
App.fixtureStore = DS.Store.create({
revision: 4,
adapter: DS.fixtureAdapter
});
App.TodoContoller = Ember.ArrayController.create({
content: App.fixtureStore.findAll(Thing.FIXTURES)
});