lundi 18 avril 2016

Ember.js - How to not reload the model on the route loading

I am developing an app where there is a huge list of items, loaded from the server by ember-data. This lists can be filtered by different fields, like date.

When you load this route for the first time, it is filtered by date: it only loads the current year items. However, the user can change those filters.

When you transition to another route and come back, the visible filters are the same as when you left, ember seems to remember them. However, since the model is loaded by the route before the controller exists and the filters are available, it loads all the current year ones.

Therefore, the result is that the user is seeing a list of all current-year items, and a set of filters that may not match.

What I would love is for the route to not reload the model if it is already available, so to save time and network; but any solution would be appreciated.




Aucun commentaire:

Enregistrer un commentaire