Why is setupController not called when using queryParams -> refreshModel: true?


#1

I am using queryParams: { myParam: { refreshModel: true } }(guides) to load another model when the query param has changed. After that i want to call a method on the controller to interact with the model after the page was rendered. Normally, i would use setupController to do something like this, but to my surprise it does not get called then changing the queryParam. So, model and afterModel are called when changing the queryParam, but setupController does not. Can you explain why?

As a workaround i could highjack afterModel and assign the model to the controller there AND interact with the controller afterwards, but i would have to overwrite setupController with an empty function. – I think that would just work, but feels a little odd. What do you think?


#2

Have you tried observing the model from the controller to hook in to changes? I’m a newb with Ember, so I’m not 100% on this, but that seems like a good way to go.