My problem is this:
I have a view (with its own viewmodel) that has 2 composed view/viewmodel pairs inside it. One of these ‘embedded’ viewmodels has an Aurelia eventAggregator subscriber defined in activate(). I want to dispose() of this subscriber in the ‘embedded’ VM’s detached() method. However, the ‘embedded’ detached() method never seems to run, when navigating away from the (outer or ‘main’) view, although the outer or ‘main’ view’s detached() method DOES fire
One result of this is that the subscribed event in the ‘embedded’ viewmodel continues to receive events, even though the page within which it is contained has been navigated away from. Obviously totally undesirable!
Any ideas please?
Cheers