I want to get which tab is active. I tried to use a @ViewChild decorator and accessing the element properties that way, but it returns null.
@ViewChild
null
This is how you can get active index of active angular material tabs
index
.html file
.html
.ts file
.ts
logChange(index) { console.log(index); }
Don't forget to add import in app.module.ts file
app.module.ts
import { MatTabsModule } from '@angular/material/tabs';