使用角度材料 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>