I have successfully implemented dynamic pill tabs with one minor issue remaining. The most crucial aspect is that when I remove a pill, I want it to return to the previously opened tab. I have provided a StackBlitz example without routes on this page: -> https://stackblitz.com/edit/pills-tabs?file=app/app.component.html
Below is all the code excluding the router page. The only difference is in line 15 of the ts file where I use routerLink="{{ tab.path }}":
<mat-chip color="primary" selected [removable]="removable" (removed)="removeTab(fruit)" routerLink="{{ tab.path }}"> {{ tab.name }} <mat-icon matChipRemove *ngIf="removable" class="x-icon"> ✖ </mat-icon> </mat-chip
I need some help with setting up the question again. The current setup works fine, but when I remove a pill, I want to navigate back to the previous tab similar to using router.go(-1) in Vue.js. How can I achieve this?