Codeblock | Description |
URLS | This section is for specifying a JavaScript array of RESTful service URLs for the gadget. You must provide relative URLs. Server details can be provided at runtime. |
init | Constructor block which initializes the core services with the $scope object, including config (gadget configuration object), restClient (AngularJS based service to invoke the RESTful services ), eventBus (AngularJS based object to pass events to the listening controllers and also receive events fired from other controllers), and URLS (the URL object mentioned in the URL section). |
defineScope | This section allows you to define the JavaScript functions to be added to AngularJS $scope object. These functions can be invoked from any place where there is access to the controller's $scope object, even from view.xhtml by using appropriate AngularJS directives such as data-ng-click. |
defineListeners | This section is for attaching the listeners to the AngularJS eventBus object. |
_handleEvents | This section is for the event handling functions for every event handler. |
destroy | This section gets invoked on controller unload. Use this to clean up any used object including event registration. |