Let's assume following code of route:
model() {
return this.store.peekAll('user');
}
and simple template:
I would like to push that firstObject
part into model because I always want to use only first record. With Ember objects it should be possible to use:
return this.store.peekAll('user').get('firstObject')
but this is not working because peekAll does not return Ember object in such way. What is the correct way of doing this?
[*] I'm using peekAll() instead of peekRecord() because peekRecord does not update when data in store are changed.
Aucun commentaire:
Enregistrer un commentaire