javascript - Getting all my events from api route events with ember-data -
currently i'm trying catch events in database 'events' route, , working, have doubts how works.
please, observe names.
so, have route, call events route:
siteapp.eventsroute = ember.route.extend({ model: function(params) { this.store.findall('event'); } });
here, i'm using eventssssss, s.
but model needs without s:
siteapp.event = ds.model.extend( description : ds.attr() name : ds.attr() type : ds.attr() )
if try use s , call this.store.findall('events');
throw strange error:
error while processing route: events assertion failed: must include 'id' undefined in object passed 'push' error: assertion failed: must include 'id' undefined in object passed 'push'
why can't use events in all? framework amazing, documentation poor, , i'm not finding resources understand conventions...
thanks.
create adapter events model
ember g adapter event
the convention pluralized version of words, in file created, need tell ember singular version of word.
pathfortype() { return 'event' }
check out ember guide more info.
Comments
Post a Comment