Learning ember and tryign to figure out why this doesn't work....
I have a model like this:
import DS from 'ember-data';
var Class = DS.Model.extend({
theclassname: DS.attr('string'),
users: DS.hasMany('user', {async: true})
});
Class.reopenClass ({
FIXTURES : [
{
id:1,
theclassname: "first",
users: [1,2,3,4,5,6,7,8]
},
{
id:2,
theclassname: "second",
users: [1,2,3,4,5,6,7,8]
}
]
});
export default Class;
In my route I can get back a model when I have it like this:
import Ember from 'ember';
var HomepageRoute = Ember.Route.extend({
model: function(){
return this.store.find('class');
}
});
export default HomepageRoute;
But when I do this to pick a single item I get errors and no data:
import Ember from 'ember';
var HomepageRoute = Ember.Route.extend({
model: function(){
return this.store.find('class', { theclassname: "first"} );
}
});
export default HomepageRoute;
I'm trying to use the examples in the guides.. and that to me looks like what was in the guides... but it doesn't work... I'm probably missing something important...
Thanks Vida.