reload vs refreshModel
See original GitHub issueHello,
I was under the impression that the reload
option was to replace the refreshModel
on the route, but it seems it does not.
It would be nice to actually regroup the route query params options under the same parachute config within the controller: https://emberjs.com/api/ember/2.14/classes/Ember.Route/properties/queryParams?anchor=queryParams
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Refresh ember model - Stack Overflow
To refresh your ember model you can use this.refresh(); . To rollback all the attributes when you leave the route you can use ......
Read more >Reloading model when using transitionToRoute approach
Hey, Assuming i'm currently in route 'foo', it sometimes make sense to requesting a model re-load for the same transition, but invoking ...
Read more >Force Ember Data to reload data from backend API
This is Ember Data's default strategy for requesting data records (either findRecord or findAll ):. If it is not loaded, load it; If...
Read more >Tweaking UI Behavior with Ember Data Queries
We define a refreshModel() action method that just calls the refresh() method. Since refresh() isn't an action, we can't access it directly from ......
Read more >Rapid Refresh (RAP)
The Rapid Refresh is a high-frequency weather forecast (numerical weather prediction) and data assimilation system, planned to replace the RUC in NCEP ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@juggy ember-parachute moves all the query param handling to the controller, and you have to manage your data fetching in the
queryParamsDidChange
controller hook. The route loses all information it has about the query params; it doesn’t need it anymore.I’m using a construct like this to refresh the model when certain query params change:
This lets you preserve your existing model hooks and loading behavior while leveraging ember-parachute.
This does not seem possible to me - you cannot refresh the route with new QPs from the same route using
transitionToRoute
.The alternative seems to be to use a route action so you have access to
this.refresh
, but if you have to do this in a child route, it seems like you’ll get “unhandled action” errors when navigating from a parent route:My problem with this approach is that it’s unclear which model will be getting refreshed. If I have an application.js model, will only that be refreshed?