ark
ark

Reputation: 3805

How to do navigation after button has been clicked using angular material 2 tabs

I am using angular material 2 tabs and i wanted to have next button in one tab which navigates to another tab after clicking it. What should i need to use to achieve that functionality?

Upvotes: 4

Views: 2907

Answers (1)

Vivek Doshi
Vivek Doshi

Reputation: 58533

Its preety simple :

<mat-tab-group class="demo-tab-group" #matgroup>
    ....
</mat-tab-group>

<button (click)='matgroup.selectedIndex = 2'>Go Next</button>

WORKING DEMO

Upvotes: 7

Related Questions