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

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

    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.

提交回复
热议问题