Ember data: what's the difference between find and findById?

I don’t understand what the difference is between the following search methods:

model: function (params) {
    return App.Publication.findById(params.publication_id);  
  },

model: function (params) {
    return App.Publication.find(params.publication_id);
  },

I'm having trouble using the findbyId method in transition.retry; in this case, the model did not load, causing errors during the transition ... See also Ember: the route identifier is lost after the transition .retry () - Am I something wrong?

+1
source share
1 answer

I think you are talking about DS.Store, because it DS.Modeldoes not have a method findById.

find findById , findById, , : id. :

  • store.find(App.Publication, 1/* */) store.findById
  • store.find(App.Publication), store.findAll
  • store.find(App.Publication, {name: 'Tom'}), store.findQuery

DS.Model.find store.find, , findById, App.Publication.find(1/* */)

+4

All Articles