Service Portal widget onload DOM manipulation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 03:59 AM
In a Service Portal Widget, how do I manipulate the DOM once the HTML template has rendered? (onload)
Thanks!
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi, an easy way that works is to utilize the ng-init directive. You can include a function there which will be executed once when the DOM and AngularJS are loaded.
Here is an example:
<div id="container" ng-init="myFunction()">
</div>You can write something like this in the Client Script:
api.controller=function($scope) {
$scope.myFunction = function() {
console.log('DOM has loaded');
}
}

