1. This code is throwing exception

Uncaught Error: Template parse errors: Can't bind to 'ngforOf' since it isn't a known property of 'mat-card'. 1. If 'mat-card' is an Angular component and it has 'ngforOf' input, then verify that it is part of this module.

div
  button(mat-raised-button, color='primary', (click)='createMocked()') Create Mocked
  div
    mat-card.Class(*ngfor="let room of rooms; let classroomIndex = index; trackBy: trackClass")

enter image description here

  1. if I will add quotes then I'm missing support from Intellij enter image description here

Does anyone have idea how to fix 1 and 2 or have woking in intellij reference that I can check? I used this article: https://medium.com/@MarkPieszak/using-pug-or-jade-templates-with-the-angular-cli-9e37334db5bc

1 Answers

1
yurzui On Best Solutions

The error

Template parse errors: Can't bind to 'ngforOf' since it isn't a known property

means that Angular template parser tries to find a directive based on your ngforof attribute but it can't since Angular template syntax is case-sensitive.

You have to write *ngFor= so it will converted to ngForOf and Angular will be able to find dedicated ngForOf directive.

If you're curious how Angular transforms structural directives into ng-template syntax then check this out: