Search code examples
angularangular17

NG5002: Cannot parse expression. @for loop expression must match the pattern "<identifier> of <expression>"


after migrating to new angular 17 and updating my template, ng serve throws this message NG5002: Cannot parse expression. @for loop expression must match the pattern " of "


Solution

  • after some diging, it was because of Capital "O" of "Of"

    for some bugs i believe, below line:

    @for (relation Of detail.Relations; track relation) {
    

    should be changed to (after auto upgrading by angular tools)

    @for (relation of detail.Relations; track relation) {