I have a tabs application with a side menu, when I click an item from the side menu, I want it to change the root view on the first tab. NOT set the root view entirely, because then the tabs disappear.
I have this as the click method on the side menu items:
The problem is that gets rid of the tabs, I want the sidebar to hide and change the root of the first tab (or tab i decide to select) as that page.component variable.
I’ve tried a bunch of different ways with this.nav.parent and such, but can not get it to work.
Also it’s weird that if I search this error, the solution is the code above, but for me does not work as they say.
Yes this is good, but I also want to set the root of the tab to a different component as well.
For example, the first tab shows a list of data, and the options in the sidebar load different lists of data for the first tab, but those lists are all different components. Possible?
Don’t know if you can change the root in that way so what you might need to do is have a service to hold what the root component for the first tab is. The side menu controller would then call something like:
Very rudmentary and not using a side nav but it does demo opening a tabs page using an given page as the root page for the first tab. Shows that it is possible just needs to be adapted to your use case.