Skip to content

Instantly share code, notes, and snippets.

@toranb
Created April 9, 2014 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toranb/10222859 to your computer and use it in GitHub Desktop.
Save toranb/10222859 to your computer and use it in GitHub Desktop.
the basic js app
App = Ember.Application.create();
App.Router.map(function() {
this.resource("people", { path: "/" });
});
App.PeopleRoute = Ember.Route.extend({
model: function() {
return App.Person.find();
}
});
App.Person = Ember.Object.extend().reopenClass({
people: [],
find: function() {
var first = App.Person.create({name: 'toran'});
var last = App.Person.create({name: 'matt'});
this.people.pushObject(first);
this.people.pushObject(last);
return this.people;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment