Closed ghost closed 8 years ago
+1
I can add something in, but i'm not sure how else to explain it :)
If you have tab routes of /user/settings/1 and /user/settings/2 if you have a link in another view pointing to .../1 or .../2 it will load the tab view with the right sub-view and the tab highlighted. So just put the link for the default route you want to use into the place that navigates to it (either $state.go or ui-sref etc).
Closing due to inactivity.
Just thought I'd try to provide some clarity here as I've been puzzling over it for some time - really just rewording your statement - now that it's working I can see how your statement makes sense, but hindsight is only so useful before you have it. .
I've just been retrofitting ui-router-tabs into an existing app with manually constructed tabs.
I have an app that has a state & view with user functionality (let's call it user), and a state & view with administration functionality - the administration view previously had manually constructed tabs in it, the first one being User Management. In my app, a user would click on an "Administration" menu item, which would navigate to the administration
state, loading all of the manual tabs, and setting User Management to visible (all manually - no states involved yet). When I retrofitted ui-router-tabs into this, creating subroutes/states for all of my child tabs, I had the same problem - no default tab.
To solve this, I needed to modify my "Administration" menu item so that instead of navigating to the administration
state, it navigated to the administration.userManagement
state. This then loaded the administration view with the tabs, and also loaded the first tab.
I've read this paragraph a few times - looked through the sample code but can not understand what this is telling me to do.....
Would it be possible to provide a small sample code?