I'm using angular material tabs to display information in each tab, I want to be able to copy/paste URL to share each tab state to different users.
I managed to change URL depending on which tab I have clicked, but when I paste that URL it doesn't work.
So far code looks like this:
<mat-tab-group (selectedTabChange)="changeRoute($event)">
<mat-tab *ngFor="let object of Projects">
<!-- info here -->
</mat-tab>
</mat-tab-group>
Function:
changeRoute(project: any) {
const queryParams: Params = { projName: project.tab.textLabel };
this.router.navigate(
[],
{
relativeTo: this.activatedRoute,
queryParams: queryParams,
queryParamsHandling: 'merge',
});
}