I have a problem with use *ngFor in Ionic v3.
<ion-list>
<ion-item-group [reorder]="reorder" (ionItemReorder)="recordTracks($event)">
<ion-item no-padding class="nomarg" *ngFor="let track of viewTracks$ | async; let i = index; trackBy: track?.TrackID">
<ion-row class="track-name" [class.active]="isTrackPlaying(track)" (click)="openTrack($event, track)"
(contextmenu)="onRightClick($event,track)">
<ng-container>
<ion-col tappable class="track-cell">
{{ track.name }}
</ion-col>
<ion-col tappable class="track-cell">
{{ track.artist }}
</ion-col>
<ion-col tappable class="track-cell">
{{ track.album }}
</ion-col>
<ion-col *ngIf="isSelectTrackEnabled" col-1 text-center class="track-cell">
<ion-checkbox class="chkbx" [(ngModel)]="track.chk" id="track.chk" color="primary"></ion-checkbox>
</ion-col>
</ng-container>
</ion-row>
</ion-item>
</ion-item-group>
</ion-list>
The first time the data in the template is displayed correctly. When viewTracks$ is updated, the data is displayed in the console but it is not in the template. Data is displayed during the update if you replace ion-item with a div.
ng-container
? what do you mean by when viewTracks$ is updated? Can you provide a reproduction of your issue in stackblitz? – Jota.ToledoisSelectTrackEnabled
supposed to do? Anyway, if you need such a variable, it needs to be unique for all items. – AT82