vendredi 27 mars 2015

Ember.js find with plain object is not working

I use Ember.js to get items like this:



App.MyData.find()


And to get item like this:



App.MyData.find(itemId)


And than I use filter and return it in model function like this:



App.MyRoute = Ember.Route.extend({
model: function() {
return App.MyData.find().filter(function(a)
{
return a.get('desc') != null;
});
}
});


And it's working just fine.


Now I wanted to pass another parameter to underlying PHP script returning items. So I used "Querying For Records desc":


"If you provide a plain object as the second argument to find, Ember Data will make a GET request with the object serialized as query params. This method returns DS.PromiseArray in the same way as find with no second argument."


According to the documentation it should behave the same way like find with no plain object argument.


But it does not. My view is not displaying anymore.


I checked GET request. It returns exactly the same data.


I have no errors in JS.


What to do to pass parameter to PHP while getting items in a way it will work?





Aucun commentaire:

Enregistrer un commentaire