mardi 19 mars 2019

set alias for `model` hook

HELP

If there is a model hook in app/routes/post.js say

model() {
  return this.store.query('post');
}

in template the returned promised is accessed using


  ...


Is there any way to set alias for the model? Something like this in route or controller?

posts: alias('model')

So I can access the returned promise in the template as


  ...


Is there something which is already there or I'm missing from the ember documentation?




Aucun commentaire:

Enregistrer un commentaire