Andrew Mairose Andrew Mairose - 1 month ago 11x
AngularJS Question

Thymeleaf parsing error when using "&&" in AngularJS expression

I have an AngularJS

attribute in my Thymeleaf template that looks something like this:

<span ng-show="aIsValid && bIsValid"></span>

When Thymeleaf tries to process this template, I get the following exception:

org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.

Does Thymeleaf just not play nicely with
logic in Angular attributes? Or is there a workaround for this other than slapping a method on my
that will simply
return $scope.aIsValid && $scope.bIsValid


Replace && with &amp;&amp; because & must be escaped in XML.