There are some static components on the page:
<app-com1 [attr.id]="'section_1'"></app-com1>
<app-com2 [attr.id]="'section_2'"></app-com2>
<app-com3 [attr.id]="'section_3'"></app-com3>
<app-com4 [attr.id]="'section_4'"></app-com4>
I have an array: let arr [1,2,3,4];
I need to get each value from arr and pass it to [attr.id] instead static data.
How to do that?
I can wrap it to loop, but I dont like it :
<ng-container *ngFor="let component of arr; let i = index">
<app-com1 *ngIf="i == 0" [attr.id]="i"></app-com1>
...etc
</ng-container>
idto ` [attr.id]`