NIdhin Paul
NIdhin Paul

Reputation: 31

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

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?

Upvotes: 3

Views: 20211

Answers (1)

eko
eko

Reputation: 40677

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()">

Upvotes: 4

Related Questions