ng-if on a portal widget

Jen11
Tera Expert

On a portal widget we have a 'work email address' field and an 'alternate email address' field.  What I am trying to do is if 'work email address' field is blank then 'alternate email address' should be mandatory.  How do I do this?

6 REPLIES 6

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I would try to figure out exactly which piece isn't working. Is your condition evaluating correctly, and is the ngRequired working how you think it should if you hardcode a true or false value?

Try

ng-required="c.registration_work_email.toString().length == 0"
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022