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

百般思念 提交于 2019-12-10 17:44:53

问题


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?


回答1:


Its preety simple :

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

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

WORKING DEMO



来源:https://stackoverflow.com/questions/48313792/how-to-do-navigation-after-button-has-been-clicked-using-angular-material-2-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!