Ember.js Routing: 'refreshModel: true' on queryParams without updating child route model

703 views Asked by At

I would like to update a parent route on queryParams change, but not any child routes. To update my parent route on queryParam change, I use refreshModel: true.

According to: http://ember-doc.com/classes/Ember.Route.html#property_queryParams, refreshModel: true will cause child route models to refire.

Can I opt out of this behavior?

1

There are 1 answers

0
Max On

In case anyone has this problem, I was able to workaround it by not using the refreshModel option at all, instead opting to use the following in my parent route:

actions: {
    queryParamsDidChange: function(params) {
        // do stuff with changed params,
        this.get('controller').set('model', *maybe ajax stuff?*);
    }
}

And only using the model hook on initial route load.