使用角形材质2选项卡单击按钮后如何进行导航

问题描述:

我正在使用角材料2个选项卡,我希望在一个选项卡中具有下一个按钮,单击该按钮后可导航到另一个选项卡.我需要使用什么来实现该功能?

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?

很简单:

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

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

工作演示

WORKING DEMO