lundi 14 mars 2016

Ember.js one api call multiple time in model hook

I want to fill up multiple drop-down from API like below where i have to pass type parameter like 'department','priority' etc. It didn't return expected result returns data of both department and priority.

//....route.js
model(){
  var _this=this;
  return Ember.RSVP.hash({
            status: _this.fetchLookup('department'),
            priority: _this.fetchLookup('priority'),
  });
},
fetchLookup(type) {
  return this.store.query('lookup', {
                    LookupType: type
                });
}



Aucun commentaire:

Enregistrer un commentaire