Business Console 10.11 | webMethods Business Console Documentation | Developing Gadgets for Business Console | Programming Gadgets | Accessing Services and Functions in XHTML Files and Controller | Accessing Services and Functions in Non-AngularJS Gadgets
 
Accessing Services and Functions in Non-AngularJS Gadgets
Non AngularJS Gadgets will not have access to AngularJS services, factories, and directives. If you have custom functions defined in the custom.js, use them directly in your controller code or in view.xhtml. It is always safer to make them unique to avoid potential conflicts.
For example:
var SomeUniqueFunction1 = function() {
this.userDefinedFunctionOne = function() {
console.log("from userDefinedFunctionOne function of mygadget");
}
this.userDefinedFunctionTwo = function() {
console.log("from userDefinedFunctionTwo function of mygadget");
}
}
var SomeUniqueFunctionId= new SomeUniqueFunction1();
In view.xhtml, call SomeUniqueFunctionId.userDefinedFunctionOne(). This will print from userDefinedFunctionOne function of mygadget in the console.