Identifier 'required' is not defined. '__type' does not contain such a member
There is a bug in angular. That compiler error will dissapear if you write that *ngIf like this:
<div *ngIf="price.errors['required']">
try to add "?" after "price".
Like this:
<div *ngIf="price?.errors.required">Price is required.</div><div *ngIf="price?.errors.min">Price should be 0 or higher.</div>
I had same problem with my VS Code. I solved it only using !!
before the condition.
Try:
<div *ngIf="!!price.errors.required">Price is required.</div><div *ngIf="!!price.errors.min">Price should be 0 or higher.</div>
More info: https://github.com/angular/vscode-ng-language-service/issues/126