$index variable not working when used in ng-container
<mat-table [dataSource]=”items”> @for (column of columnsDefinitions; track column; let index = $index) { <ng-container matColumnDef=”{{column.name}}”> <mat-header-cell *matHeaderCellDef> <div [ngClass]=”{ ‘highlighted’: index === 2 }”> Text </div> </mat-header-cell> <!–Cell definition omitted–> </ng-container> } <mat-header-row *matHeaderRowDef=”columnsToDisplay”></mat-header-row> <mat-row *matRowDef=”let row; columns: columnsToDisplay”></mat-row> </mat-table> @Component({/* Omitted */}) public class TableComponent { @Input() public columnsDefinitions: {name: string}[] = []; @Input() […]
$index variable not working with ng-container
<mat-table [dataSource]=”items”> @for (column of columnsDefinitions; track column; let index = $index) { <ng-container matColumnDef=”{{column.name}}”> <mat-header-cell *matHeaderCellDef> <div [ngClass]=”{ ‘highlighted’: index === 2 }”> Text </div> </mat-header-cell> <!–Cell definition omitted–> </ng-container> } <mat-header-row *matHeaderRowDef=”columnsToDisplay”></mat-header-row> <mat-row *matRowDef=”let row; columns: columnsToDisplay”></mat-row> </mat-table> @Component({/* Omitted */}) public class TableComponent { @Input() public columnsDefinitions: {name: string}[] = []; @Input() […]
How can I use back button in angular project dynamically?
I have generated one back button component in my Angular 15 project and I want to show this back button across multiple pages in my project. I want to dynamically go back to previous screen using Angular routing so I have defined the back button component like: