I’ve been using activate() for all sorts of things on route view models for quite some time and it has worked just fine so far. But now, I’m really puzzled and do hope someone can shed some light on this:
So this just be straight forward. Both routes show up just fine in the navigation. But somehow activate() (or canActivate() as well) is not being called when I switch from one route to the other. Only when the two routes use different modules, the methods are called. Is this intended behaviour that I just have not encountered so far or am I doing something wrong?
since its the same viewmodel by default it gets reused so no lifecycle hooks are called. you can override the behavior as mentioned here Router Configuration | Aurelia
Hm… I’ve spent so much time on that particular documentation page over the last few years, but somehow I must have missed this section so far! Thanks so much for pointing it out @zewa666 !
Same here. I’ve recently implemented a view where I use the query parameters for subsequent changes to the view, and nothing was changing. This solved my problem for me.