I have a model made by 3 other nested models in Ember and I want to use data from one of them for a parameter for another one.
I have got a model to set the configuration of my App (hotTopicConfig) The thing is that I want to use data from hotTopicConfig to use it as a parameter in hotTopics Model
return new Ember.RSVP.hash({
hotTopicConfig : self.store.findQuery('hot-topic-config', {
touchpointId :params.touchpointId,
}).then(function(results){
self.set('periodType',results.get('periodType'))
return results.get('firstObject');
}),
hotTopicSortByType : self.store.find('hot-topic-sort-by-type'),
hotTopics: self.store.findQuery('hot-topic', {
touchpointId : params.touchpointId,
periodType : HERE I WANT TO USE DATA FROM hotTopicConfig
})
.then(function(results){
return results.get('firstObject');
})
I have used several solutions but none of them workt for me, like external and additional calls to AJAX call.
Is there any other way to do this?
Thanks.
Alberto
Aucun commentaire:
Enregistrer un commentaire