Hi,
This is how I have implemented tab in my application
<material-tabs selected="selectedTab" center>
<material-tab label="first"></material-tab>
<material-tab label="second"></material-tab>
</material-tabs>
<div class="animate-switch-container" ng-switch on="selectedTab">
<div class="animate-switch" ng-switch-when="0">
Some content
</div>
<div class="animate-switch" ng-switch-when="1">
Some content
</div>
When I try to set the selectedTab variable in my controller, the tab does not move to the one selected. Is this the intended behaviour or am I missing something?
I don't think the "selected" attribute is bound to material-tabs. Assigning a value during runtime does not change the selected tab. Any way around this?
Basically what I'm trying to do here is run an xhr request based on selection in tab 1. If results are received, the tab 2 content get populated and tab 2 is selected.
Thanks
@see Dynamic Tabs Demo and view source:
<material-tabs md-selected="selectedIndex" style="background-color: #00bcd6">
If somewhere stumbles upon this one, that's md-selected
and not selected
.
Most helpful comment
If somewhere stumbles upon this one, that's
md-selected
and notselected
.