Open a tab from controller


#1

Hi,

I am using the starter project and the tab directive.

From the controller of the page containing the tabs, how can I open one tab ?

I tried to
1/ Inject a TabBarManager into the page controller
2/ call : TabBarManager.find(‘pocreate_resupply’).select(1);

Loading the page, I have the error :
Error: [$injector:unpr] Unknown provider: TabBarManagerProvider <- TabBarManager

Is it the right way to do ? If yes where am I doing wrong ?

Thanks,

St.


#2

Each tab should be it’s own state, so you can just use something like $state.go('tab.adopt') to go to the adopt tab in the seed project for example.

Just remember to inject $state.


#3

Thank you for taking the time to answer.

I did what you suggest:
0/ Create my tab :
1/ Inject the $state
2/ $state.go(‘tab.poLineDetail’)

but I have the error : Could not resolve ‘tab.poLineDetail’ from state ‘po_create’

I tried to attach the $state at the $rootScope, but it didn’t change anything.


#4

got it work thanks to this thread : Sign-in page without tabs, then once signed-in tabs show