Widget - script event when a form finishes loading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2018 07:40 PM
Hi folks,
just wondering if anyone happen to know any events in a Service Portal client script that get fired as soon as the form finishes loading,
I've been looking into
$timeout(function() { }, 1500) // if the ms 1500 not given, it doesn't seem to fire at all, however, this works on short form, not on relatively longer form as it can take more than 1500ms to load.
$scope.$on('spModel.gForm.initialized', // not so sure what is this, but looks like something I am after?
$scope.$watch(function() {} // it appears this get fired on certain events I am not too sure of, but if putting my scripts in this block it seems to work.
If anyone could advise any more events that I should be consider, it would be appreciated.
Thanks,
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2020 01:43 AM
Did anyone got the answer to this one ?...i am also having the same issue ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 01:51 AM
This is the closest method I could find to identifying when AngularJS has finished processing the page load.
I know it's not rock-solid method.
Service Portal Widget Client Script:
$scope.$watch('$viewContentLoaded', function() {
$timeout(function() {
//Code to run
}, 0);
});