rpocklin/ui-router-tabs

Make a tab activated by default

bastienJS opened this issue · 3 comments

I am glad someone is trying to solve this misery with ui router and bootstrap tabs.

I check your demo: http://rpocklin.github.io/ui-router-tabs/example/index.html

Initially no Tab is selected. That is far from real life (hide information from the user).

How can make the 2nd tab selected via tab configuration?

As quoted from docs in README.md:

UI Bootstrap Tabs will not select a tab by default. If you want it to, specify the target sub-route when you show the tabs (ie. link the ui-view containing the tabs with the default (first) element as the sub-route example/#/user/settings in the example.)

There was a change in the bootstrap tabs library to not select the first tab by default anymore, if you look at bootstrap tabs v0.13.0 you will see the same behaviour.

so... the result is I am not quite sure that I understand you :D How would I have to change the markup for the first tab if I want this one selected by default?

If you make a link to the route which maps to the first tab state via ui-sref (or url, via href) it will select the correct tab and show the content for that. Eg. http://rp.js.org/ui-router-tabs/example/index.html#/user/settings