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

后端 未结 4 1894
我寻月下人不归
我寻月下人不归 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

    With Ember Data 1.0.0-beta.X:

    App.YourModelType.store.find("yourModelType", someId).then( 
      function(modelInstance) { 
      ...
      });
    

提交回复
热议问题