Hide an element in a DIV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 12:34 PM
Hello,
I am new to ServiceNow and Angular.
How can I hide a <div> on a widget through the portal?
I am able to not populate info to the <div>, but it just adds a big blank space.
what I have is:
<div ng-if="!c.data.accounting" ng-bind-html="c.data.marketing"></div>
I want to also perform a hide on this <div>
THanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 02:41 PM
Solution 1:
<div *ngIf="show" class="row container-fluid" id="divshow" >
Div Content
</div>
Solution 2:
<div [hidden]="!show" class="row container-fluid" id="divshow" >
Div Content
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2020 05:55 AM
I do something very simple in the server-side script by setting the values and then passing then binding them to my widget:
Server-Side Script:
(function() {
data.marketing = options.marketing;
})();
I want to write a function that checks if this value is true, and if it is true, I want to show my <div> and if it is false, I want to hide my <div>