Hello,
I’m making some improvements to my tabbed viewer as I migrate from Au 1.0 1o Au 2.0.
As I click through the tabs, activate is called and all is well for the incoming component; deactivate, however, is not called on the outgoing component.
And, actually, only the model and session are being replaced. The component isn’t changing. I have this:
<div class="tsi-doc-viewer-view">
<au-compose
component.bind="dm.activeDoc.docComponent"
model.bind="dm.activeDoc.model"
session.bind="dm.activeDoc.session"
></au-compose>
</div>
So, dm.activeDoc.docComponent doesn’t change. However, dm.activeDoc.model does. session is forwarded to the component composed.
How can Aurelia reliably call activate when a new model is bound, but not call deactivate on the outgoing component? I know I can take a component ref on the composition, and then imperatively call deactivate() on the component. But it seems like I shouldn’t have to do that. I don’t do that in the Au 1.0 app.
Did something change in 2.0?