With the recent update, I know that in routers and controllers, I can easily just do this.store.find(\'model\')
. However I have some functions that need to call
The TRANSITION doc says that you can do this to inject the store into components :
App.inject('component', 'store', 'store:main');
You might be able to change 'component'
to 'view'
or to 'model'
, but I'm not sure about that.
With Ember Data 1.0.0-beta.X
:
App.YourModelType.store.find("yourModelType", someId).then(
function(modelInstance) {
...
});
You can do
App.Model.store.find('model')
If you have a particular attribute to filter with, you can do:
App.Model.store.find('model', {'attribute_name' : 'matching_to_this_value'})
See more on this post.
You can try to do
this.get('controller').get('store').find('model')
That would wok in a View for example.