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.

Help with sp_ng_template

Ankita9793
Tera Contributor

Hi 

 

Can someone please help me with below script in a sp_ng_template. I want to add OR condtion for ng-if="c.data.offNetworkOptionSelected == 'Moved departments'" OR ng-if="c.data.offNetworkOptionSelected == 'hsbc_office_not_required'", I have tried OR and || but its not working. 

 

 

   <div ng-if="c.data.offNetworkOptionSelected == 'Moved departments'"  style="margin-top:10px" || ng-if="c.data.offNetworkOptionSelected == 'hsbc_office_not_required'"  style="margin-top:10px" >

 

 

TIA

1 REPLY 1

Marcos Kassak
Kilo Sage

Hi @Ankita9793,

 

The below script would work:

 

 

<div ng-if="c.data.offNetworkOptionSelected == 'Moved departments' || c.data.offNetworkOptionSelected == 'hsbc_office_not_required'" style="margin-top:10px">
  <!-- Your content here -->
</div>

 

 

You also need to make sure that your variables have the values that you want so they can work properly. 

 

The div will be displayed if c.data.offNetworkOptionSelected is equal to either 'Moved departments' or 'hsbc_office_not_required'. The || operator is used within the ng-if directive to check for either condition.

 

If you found my answer helpful or correct in any way, please don't forget to mark it to help future readers! 👍

 

--

 

Kind regards,


Marcos Kassak
Solution Consultant  🎯