Is it possible to prevent tab change in angular-material's md-tabs or md-tab directive? I use the md-on-select directive to execute a function once a tab is clicked and set the md-active value to false for a specific tab. But the tab switch still happens and I seem not to be able to prevent it:
<md-content>
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Tab1" md-active="ctrl.selectTab1" md-on-select="ctrl.tabClicked('Tab1')">
<md-content>
myContent
</md-content>
</md-tab>
<md-tab label="Tab2" md-active="ctrl.selectTab2" md-on-select="ctrl.tabClicked('Tab2')">
<md-content>
mycontent
</md-content>
</md-tab>
</md-tabs>
</md-content>
In the controller function I have
function tabClicked(tab) {
switch (tab) {
case 'Tab1':
vm.selectTab1 = true;
vm.selectTab2 = false;
break;
case 'Tab2':
vm.selectTab1 = false;
vm.selectTab2 = true;
break;
}
}