$rootScope.$broadcast - confusing argument

Milan13
Giga Expert

Hello,

in my service portal widget I have this client script snippet of code:

$scope.copyFromPreviousTimesheet = function(){

$rootScope.$broadcast('tcp.copy.timesheet');
};

This is triggered by clicking a button - please see below snippet of HTML template:

<button type="button" class="btn" ng-click="copyFromPreviousTimesheet()" aria-haspopup="true">${Copy from previous Time Sheet}</button>

I guess the code in bold (tcp...) should be a script include or something like that but cannot find anything like that in my script include list.

Also what makes me really confused is that probably another widget is generated by clicking the button and I have no idea how this could be done via script include.

Appreciate any help on this.

Milan

5 REPLIES 5

Service Portal events do not need to be registered in the Event registry. Only events triggered from gs.eventQueue() are subject to that requirement.

 

FYI - A response to this post was featured on the Community Live Stream video. I invite you to watch the episode.

Video: Community Live Stream - 2020-02-10 - Developer Community - ServiceNow Community