Parser error: Unexpected token at column error after angular update to 12

Viewed 4643

I am getting this build error - NG 5002 Parser error : unexpected token "=" at column 2 in the below component.html file line

<button id="asd" [disabled]="sendMail.Invalid" type="button" (click)="hideexampleMail()">

Another place i am also getting the same error, ie

<div *ngIf="showExmapleMail"></div>

I was migrating my angular 8 application to Angular 12.

Any idea?

1 Answers

Since the template validation is more strict with Angular 12, the problem might be caused by an undefined value. You might want to try:

<button id="asd" [disabled]="sendMail?.Invalid" type="button" (click)="hideexampleMail()">
Related