Ember Latest
The latest build of Ember.
by marciojunior
HTML
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<script src="https://s3.amazonaws.com/builds.emberjs.com/ember-data-latest.js"></script>
<script type="text/x-handlebars" data-template-name="index">
<h2>People:</h2>
<ul>
{{#each people}}
<li>{{name}}</li>
{{/each}}
</ul>
<h2>Companies:</h2>
<ul>
{{#each companies}}
<li>{{name}}</li>
{{/each}}
</ul>
</script>
CSS
h1 { font-size: 1.6em; padding-bottom: 10px; }
h2 { font-size: 1.4em; }
ul { padding: 15px; font-size: 1.4em; color: green; }
JavaScript
App = Ember.Application.create({});
App.ApplicationAdapter = DS.FixtureAdapter;
App.IndexRoute = Ember.Route.extend({
model: function() {
return Ember.RSVP.hash({
people: this.store.find('person'),
companies: this.store.find('company')
})
}
});
App.Person = DS.Model.extend({
name: DS.attr('string')
});
App.Person.FIXTURES = [
{id: 1, name: 'John'},
{id: 2, name: 'Luci'},
{id: 3, name: 'Paul'},
];
App.Company = DS.Model.extend({
name: DS.attr('string')
});
App.Company.FIXTURES = [
{id: 1, name: 'Yahoo' },
{id: 2, name: 'Google' },
{id: 3, name: 'Facebook' },
];