I am using angular 5 and I’m trying to check the value of a variable in the html template of the component.
So it looks something like this:
I’m getting this error:
ht Error: Template parse errors:
Parser Error: Bindings cannot contain assignments at column 17 in...
Can’t this be done on angular?
*ngIf work like this
*ngIf="expression" where the
boolean. But you use one
= and it means that you assign the
someValue to the
item property and if the value is not falsy it will return you
In your case you need to write
*ngIf="item === 'somevalue'".