Angular 2 How to "watch" for tab changes
You could use the (selectedTabChange)
event. Check Material2#tabs.
Template:
<mat-tab-group color="primary" (selectedTabChange)="onLinkClick($event)">
...
</mat-tab-group>
Component:
import { MatTabChangeEvent } from '@angular/material';
// ...
onLinkClick(event: MatTabChangeEvent) {
console.log({ event });
this.router.navigate(['contacts']);
}