app.component.html
<h2 style="padding-top:25px; padding-bottom:25px;">
Angular Material - How to get Tabs selected index
</h2>
<h3>
Tabs selected index : {{tabs.selectedIndex}}
</h3>
<mat-tab-group #tabs>
<mat-tab label="Android">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nam tincidunt elit non molestie rutrum.
Donec blandit risus et sem iaculis aliquam.
</mat-tab>
<mat-tab label="Kotlin">
Cras feugiat pharetra dolor, ac euismod tellus maximus eu.
Etiam dignissim enim vel lacus molestie, in iaculis tellus
ultrices.
</mat-tab>
<mat-tab label="Java">
Integer rhoncus tristique felis ut dignissim.
</mat-tab>
</mat-tab-group>
app.module.ts [import]
import { MatTabsModule } from '@angular/material/tabs'
- angular - How to use clearInterval()
- angular material - Show custom color in Progress bar
- angular material - How to change Divider width
- angular material - How to change Divider thickness
- angular material - How to use indeterminate Progress spinner
- angular - How to use setTimeout()
- angular material - How to change Progress spinner color
- angular material - How to center Progress spinner
- angular material - How to align Tabs
- angular material - How to disable Tabs content animation
- angular material - How to slow Tabs content transition
- angular material - How to use Tabs selectedTabChange event
- angular material - How to use Action List
- angular material - Action list with button and icon
- angular material - How to use Selection List