I have a problem after updating to angular 12 from angular 11 the whole project is red with errors in VS Code wherever I'm using input type="number" with min = "1" and [(ngModel)].

The error is

Parser Error: Conditional expression min ?? null requires all 3 expressions at the end of the expression [min ?? null] in ...
Parser Error: Unexpected token ? at column 6 in [min ?? null] in ...

So for example this line is the problem:

<mat-form-field class="example-full-width margin-left-10 ">
<input matInput class="form-control textarea-border" type="number"
                      style="font-size: 20px; text-align: center; "
                      min="0"
                      [(ngModel)]="model.OdvagaPrva"/>
</mat-form-field>
  • If I remove min="0" line then I don't get this error
  • If I put type="text" then I don't get this error
  • If I remove ngModel line then I don't get this error

enter image description here

Edited: mat-form-field tag

0

There are 0 answers