Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Broadcase is not working properly in the walk up experience module portal

chandan86patra
Tera Contributor

HI All ,

 

This script is not working properly .while using broadcast method value is not coming in the alert(data). I am using code in the client script.

widget -1

c.data.controller = recordIds;
c.server.update().then(function(resp) {
c.data.controller = '';
c.data.waitingList=resp.formattedwaitingList;
var ab=JSON.stringify(c.data.waitingList);
console.log('test_296'+JSON.stringify(c.data.waitingList))
$rootScope.$broadcast('rakesh',ab);
//alert(ab);

})

widget-2

alert('test133');
$rootScope.$on('rakesh',function(event,data){
alert('test133');
alert(data);

})

 

Thanks , Rakesh

1 REPLY 1

SusmithaA
Tera Contributor
  • Try to use console.log('Event received:', data); to check functional called correctly.
  • Trr to use this 
    api.controller = function($scope, $rootScope, spModal)
    $rootScope.$on('rakesh',function(event,data){
    spModal.alert(data);

    If you find this as helpful and rectified your problem please mark as accepted solution and give thumbs up