Angular 10.1 Ivy doesn't understand *ngFor directive

114 views Asked by At

Since my upgrading from Angular 10 to 10.1, my ivy compiler have started to misread ngFor directives.

e.g.

mat-grid-tile(
    *ngFor='let preview of previewList; trackBy: trackByFn'
    )
    img.previews__img(
      #previewImage,
      )
    mat-icon(
      (click)='deletePreview(preview.name)',
      ) delete
    canvas.previews__canvas(
      #previewCanvas
      )
    .previews__name {{preview.name}}

Ivy randomly advice me:

error TS2339: Property 'preview' does not exist on type

It's trivial that preview it's a property inside *ngFor directive scope, but Ivy seems not understand that. How can I solve this?

1

There are 1 answers

0
paulhenry On

Close your running server. Start ng serve again.