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 find
that are not in routers and controllers. So how can I get an instance store
from anywhere in an Ember App?
I know worst comes to worst I can do App.__container__.lookup('store:main')
, but I'll try to stay away from that.
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.