I need to install several controller models in the hook applicationRoute:
model: function() {
this.controllerFor('markets').set('model', this.store.pushPayload('market', marketsCache));
this.controllerFor('pages').set('model', this.store.pushPayload('page', pagesCache));
this.controllerFor('categories').set('model', this.store.pushPayload('category', categoriesCache));
this.controllerFor('employees').set('model', this.store.pushPayload('employee', employeesCache));
}
In my webservers index.php file I set the variables javascript marketsCache, pagesCache, categoriesCacheand employeesCache. They are retrieved from the APC cache because the API intensively requires requests.
As you can see, I want the application to expect the model to be filled. However, promises are only for AJAX requests, as far as I know. So the question is, can these lines be wrapped controllerForin a promise?
source
share