Business Console 10.7 | webMethods Business Console Documentation | Developing Gadgets for Business Console | Programming Gadgets | Defining Success and Error Notification in Gadgets
 
Defining Success and Error Notification in Gadgets
Use EventBus to trigger success and error notifications from a gadget.
To send success notifications, use the code below.
$scope.eventBus.fireEvent(NotificationConstants.SUCCESS,"PROVIDE YOUR
SUCCESS MESSAGE HERE");
To send error notifications, use the code below.
$scope.eventBus.fireEvent(NotificationConstants.ERROR,"PROVIDE YOUR
ERROR MESSAGE HERE");
You can send notifications to any place that is within the scope of the EventBus object. In the controller init block, add the EventBus in the $scope object so that the EventBus is easily accessed through the $scope object (such as directives).