vendredi 21 octobre 2016

How on init make a POST call based on model resolve

i am newbie in ember and need your help.

In the application/route.js I need to make a POST call based on response that model gets. Something like this in route.js:

export default Route.extend({
  ajax: inject.service(),
  details: inject.service(),

  model() {
      return this.get('details').fetchAccount();
  },

so once model gets resolved on init I will need to make a call. The model has status, which run a call if it is true.

init() {
    if (model.user) {
       ...
    }
}

Any thoughts how to accomplish that?




Aucun commentaire:

Enregistrer un commentaire