export default Ember.Route.extend({
model: function() {
return this.store.all('foo');
}
});
I want to use store.all
instead of store.find
, correct, since I don't want to load the contents from HTTP?
Then: models/foo
export default DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string')
});
Or should I not be using a model, and an Ember Object instead? The docs for initializing an object say to use App.Foo.Create()
, but AFAIK ES6 modules have gotten rid of the App namespace?
Ultimately I want to define a model, then pass that to a component and edit the values. After which I'll save each instance instance of that created model until I need to do something with them.
Aucun commentaire:
Enregistrer un commentaire