Help with sp_ng_template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 01:33 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 06:31 AM - edited 12-15-2023 06:31 AM
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 🎯