Created
April 9, 2014 03:14
-
-
Save toranb/10222859 to your computer and use it in GitHub Desktop.
the basic js app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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