- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 09:36 PM
I have a requirement where I want a dialog window containing html contant to display on click of button in Service Portal.I am new to ServiceNow and have got to know that dialog does not work in portal.
Please help!
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 09:42 PM
Hi,
To create a dialog window in ServiceNow, Please use the below mentioned code in your widget in widget editor.Also please include $uibModal, and $scope in top function parameters if not already added.
Client Script:
var c=this;
c.openModal = function() {
c.modalInstance = $uibModal.open({
templateUrl: 'modalTemplate',
scope: $scope
});
}
c.openModalType = function() {
c.modalInstance = $uibModal.open({
templateUrl: 'modalTemplateType',
scope: $scope
});
}
c.closeModal = function() {
c.modalInstance.close();
}
HTML Template:
Please include the below code in html template:
<script type="text/ng-template" id="modalTemplateType">
<div class="panel panel-default" style="background:#fff;color:#00A0D0;font-weight:bold;">
<div class="panel-heading">
<h4 class="panel-title">What Type of System do I have?</h4>
</div>
<div class="panel-body wrapper-xl">
<ul>
<h5>test text</h5>
</ul>
</div>
<div class="panel-footer text-right">
<button class="btn btn-primary" ng-click="c.closeModal()">${Close}</button>
</div>
</div>
</script>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 09:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 09:44 PM
Thanks for your help. I will check it 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 10:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 10:48 PM
Sure Sir. Thank you 🙂