error NG5002: Parser Error: Unexpected token ===

149 views Asked by At

we are stuck in a problem in angular. if we run the angular 16 project with micro-frontend then we see this error

error NG5002: Parser Error: Unexpected token ===

enter image description here

2

There are 2 answers

5
dinesh On

Change the condition *ngIf="optionalFieldValue==='password'" To *ngIf="optionalFieldValue=='password'"

When you try to use the === operator in a template, which is not allowed in Angular templates, comparison operator to use in Angular templates is== or !=.

https://angular.io/guide/template-typecheck

0
amir balazade On

What is optionalFieldValue type is your ts file: how did you define this variable and how does it get data? these problems usually occurs when the types are not accurately provided.