Skip to content

Instantly share code, notes, and snippets.

@commadelimited
Created April 11, 2014 13:41
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 commadelimited/10469968 to your computer and use it in GitHub Desktop.
Save commadelimited/10469968 to your computer and use it in GitHub Desktop.
Data loads, never displays
App.PeopleController = Ember.ArrayController.extend({
sortAscending: true,
sortProperties:['First', 'Last'],
init: function(){
debugger;
}
});
App.PeopleRoute = Ember.Route.extend({
name: 'people',
init: function(){
// deactivate spinner here
},
setupController: function(controller, profile){
// this.controllerFor('people').loadData();
},
model: function(){
// debugger;
return this.store.find('person');
}
});
App.Person = DS.Model.extend({
First: DS.attr('string'),
Last: DS.attr('string')
});
App.PersonSerializer = DS.RESTSerializer.extend({
normalizePayload: function(type, payload) {
var result = [],
obj;
payload.forEach(function(el, index){
el['id'] = index;
result.push(el);
});
return {'person': result };
}
});
App.Router.map(function () {
this.resource('people', { path: '/people' }, function(){
this.resource('person', { path: ':person_id'});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment