IntoTheVoid has a good solution - it's nice to have a place to hide / view. But how do you activate the logic?
In my experience, routers are the best place to do this. When the route changes and the corresponding function is called, you must update the active, visible view (s).
What if you need to see several views at once? If you have a primary view that always changes when you change the route, as well as several auxiliary widgets, you do not need to worry. But if itβs more complicated, consider creating a ComboView that neatly packs all the relevant views into one containing an el node. Thus, the above logic still works, and your router functions are not dotted with logic to control which views are currently visible.
Christian willman
source share