Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Angular multi-condition ngShow - The entity name must immediately follow the '&' in the entity reference.

Justin Lee2
Tera Guru

I have a UI page.  In one of the divs, I have using ngShow with multiple conditions.  However, I cannot save the UI page because I get the error:  "The entity name must immediately follow the '&' in the entity reference."

<div ng-show="condition1 && condition2">

</div>

Is there a workaround for this?

Thanks.

 

1 ACCEPTED SOLUTION

rbeeman
Mega Sage

UI Pages are written in Jelly, which is XML, so you must escape ampersands. This should work:

<div ng-show="condition1 &amp;&amp; condition2">

</div>

Ref: https://www.w3schools.com/xml/xml_syntax.asp

 

If that doesn't work, it looks like ${AMP} might be what you need to use: https://docs.servicenow.com/bundle/newyork-application-development/page/script/general-scripting/con...

View solution in original post

2 REPLIES 2

rbeeman
Mega Sage

UI Pages are written in Jelly, which is XML, so you must escape ampersands. This should work:

<div ng-show="condition1 &amp;&amp; condition2">

</div>

Ref: https://www.w3schools.com/xml/xml_syntax.asp

 

If that doesn't work, it looks like ${AMP} might be what you need to use: https://docs.servicenow.com/bundle/newyork-application-development/page/script/general-scripting/con...

&amp;&amp; worked.  Thanks Robert!