Vote count:
0
I'm working on a webapp to teach myself Ember, and I've walked into one large issue:
The page halts while it is attempting to fetch json.
App.IndexRoute = Ember.Route.extend({
model: function() {
var store = this.store;
return Ember.RSVP.hash({
pokeballs: App.Pokeball.all(),
pokemon: store.find('pokemon'),
status: App.Status.all(),
levels: App.Levels
});
}
});
this.store.find('pokemon')
uses the RESTAdapater, and can freeze the page from rendering anything (besides the loader) for up to 1.5 seconds.
My understanding... is the model that gets returned from the IndexRoute gets passed directly to the IndexController.
So my question: what is the best way to architect my IndexRoute and IndexController relationship so that the user doesn't have the page halted while the pokemon data is loaded.
Webapp Demo: http://theirondeveloper.github.io/pokemon-catch-rate
Github: https://github.com/TheIronDeveloper/pokemon-catch-rate
asked 1 min ago
How do I split apart the REST calls from my IndexRoute?
Aucun commentaire:
Enregistrer un commentaire