lundi 14 août 2017

Ember Iterating through a promise/ store.findAll return value

In my router I have code let users= this.store.findAll('user')

And my model user.js will be name: DS.attr('string'), userName: DS.attr('string'), company: DS.attr('string')

In my mirage fixture I have User object defined as [{'name':'smith','userName':'smith123'},{'name':'james','userName':'james222'}

And in my router when I do let users= this.store.findAll('user') I want to iterate through users and add company manually for each user. But I am unable to find the way to access the user objects in router js file.

And same object I can iterate in .hbs file. But unable to find the way to iterate it in router js file. Can you please let me know the way to do this.




Aucun commentaire:

Enregistrer un commentaire