mercredi 21 décembre 2016

Ember data model recordArray toArray issue

I use ember 2.9.1 and ember data 2.9.0.

I have a simple model say 'users' which has 'name' and 'address' fields. When i query the model using findAll('user'), the data from server is right. But when i try to get the actual data(using toArray) from the recordArray returned, the data i get array of classes.

i.e., if i have two users, then i get an array of classes instead of the actual data i expect like([{name:"user1", address: "address1"},{name:"user2", address: "address2"}]) to give to the template.

Am i doing it right?




Aucun commentaire:

Enregistrer un commentaire