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">
    Content: {{model}}<br/>
    Constructor: {{model.constructor}}
</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.Store = DS.Store.extend({
    adapter: DS.FixtureAdapter
});

App.IndexRoute = Ember.Route.extend({
  model: function() {
      return this.store.find('person').then(function(people) {
          return people.map(function(person) {
              return [person.get('firstName'), person.get('lastName')]
          });
      });
  }
});

App.Person = DS.Model.extend({
    firstName: DS.attr('string'),
    lastName: DS.attr('string')
});

App.Person.FIXTURES = [
    {id: 1, firstName: 'Kris', lastName: 'Selden'},
    {id: 2, firstName: 'Luke', lastName: 'Melia'},
    {id: 3, firstName: 'Formerly Alex', lastName: 'Matchneer'}
];