Business Console 10.11 | webMethods Business Console Documentation | Developing Gadgets for Business Console | Programming Gadgets | Loading a Gadget or an AppSpace in a Modal Dialog Box | Loading a Gadget in a Modal Dialog Box
 
Loading a Gadget in a Modal Dialog Box
1. Inject AppspaceUtilityService into the controller or service.
2. Use the service to load the gadget.
You can use the following code:

appspaceUtilityService

.newGadgetModal() //to ensure a new modal instance
//is opened by closing any exisiting one
.showHeader(false)//true or false depending on whether you
//want to show the header
.params(params)//Optional. If you want to pass parameters to
//the gadget, you can do so as shown below
.scope(this.$scope) //To pass the scope
.gadgetId("<GADGET_ID>") // The ID of the gadget to launch
.launchGadget();

If you want to pass paramters, create a variable as shown below
before calling the launchGadget method.
var params = {"KEY1":"VALUE1","KEY2":"VALUE2"};