Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the active tab In Angular Material

I want to find active tab in material and save in cookie:

var activeTab = $cookieStore.get("active");
$cookieStore.put('active',$scope.selectedIndex);
console.log(active);

How can I find active tab in angular material

Here is codepen example

like image 971
TheNone Avatar asked Feb 05 '16 13:02

TheNone


1 Answers

Using md-on-select="onTabChanges(tabNumber)" you can "watch" for tab changes.

Example in this codepen: Angular Material Selected Tab

like image 119
ronIDX Avatar answered Sep 23 '22 13:09

ronIDX