How to get Ember Data's “store” from anywhere in the application so that I can do store.find()?

后端 未结 4 1893
我寻月下人不归
我寻月下人不归 2021-02-07 09:47

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

4条回答
  •  滥情空心
    2021-02-07 10:17

    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.

提交回复
热议问题