I would like use layout tabs material with Angular:
https://material.angular.io/components/tabs/overview
I would like use auto click, how I do it ? how ask angular to click link "Tab1" wait 3 seconds and click"Tab2" in the loop.
I would like use layout tabs material with Angular:
https://material.angular.io/components/tabs/overview
I would like use auto click, how I do it ? how ask angular to click link "Tab1" wait 3 seconds and click"Tab2" in the loop.
You can bind to the selectedIndex
property of the <mat-tab-group>
like so:
html:
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Tab 1">Content 1</mat-tab>
<mat-tab label="Tab 2">Content 2</mat-tab>
</mat-tab-group>
component:
selectedIndex = 0;
...
ngOnInit() {
setTimeout(() => {
this.selectNextTab();
}, 3000);
}
selectNextTab() {
this.selectedIndex++;
}
...
setInterval()
– Ploppy