I have a md-tabs
tag which 2 md-tab
tags:
<md-tabs id="tabs" class="md-accent" md-align-tabs="top" md-dynamic-height>
<md-tab id="tab1">
<md-tab-label>Tab 1</md-tab-label>
<md-tab-body>
<div ng-include="'tab1.html'"></div>
</md-tab-body>
</md-tab>
<md-tab id="tab2">
<md-tab-label>Tab 2</md-tab-label>
<md-tab-body>
<div ng-include="'tab2.html'"></div>
</md-tab-body>
</md-tab>
</md-tabs>
I can switch between them properly by clicking in them (in the menu) but what I want is to be able to perform click on tab1
for example. Let's say that inside on tab2
I make a submit via AJAX
and once I get the success
I want to switch automatically to tab1
.
I've tried lot of things, I've set the attribute selectedIndex
from md-tabs
, I've set the attribute md-active
of md-tab
to true
. I've also tried to call the method which supposedly is fired by event click (select()
from $mdTabsCtrl
). But obviously nothing of this has worked.
So, how can I switch to a specific tab when I click one of my custom buttoms?