mardi 3 mai 2016

ember 2.5 trying to query for records using guide

New to ember. Using 2.5.

I've got a list of records, and I want to implement a text search. I have to implement infinite scroll as well, so I guess 'search'ing is more appropriate than 'filter'ing, since eventually I won't have all records returned.

1] I'm following the 'Querying for Multiple Records' guide here http://ift.tt/24ozowl

So I'm trying to use this format:

this.store.query('person', { filter: { name: 'Peter' } }).then(function(peter) {
  console.log(peter);
});

This makes a GET, which I can see returns all records, and then spits out a CLASS object:

Class {query: Object, store: Class, manager: Class, isLoaded: true, meta: EmptyObject…}

I don't really know what kind of thing 'peter' is. I do not see any records listed in it. (Yes, my data does have a Peter in it.)

2] To see what it's supposed to be doing, I've started a twiddle, here: http://ift.tt/23npeGu

This twiddle did not have a model in it so I added one. But its choking on the GET so obviously this is not the way to implement searches in a twiddle.

Not sure how to get this up and running.




Aucun commentaire:

Enregistrer un commentaire