I'm using ng-show
as shown below:
<data-ng-show={{entity.primary}}===true>
The value of entity.primary
can be either true
or false
. I am getting the following error in the console:
Syntax Error: Token 'false' is at column {2} of the expression [{3}] starting at [{4}].
How can this error be fixed?
Sadly, your code is a concentrate of errors:
ngShow
directive can only be used as an attribute, and not as an element, as shown by the documentation and the code.ngShow
directive expects an "expression", which is (by and large) standard JavaScript code: you don't need additional curly brackets.=
in your attribute, quotes are mandatory around its value, as explained by this W3C note.Therefore, the correct code is: