In the aiWARE SDK, event listeners listen for and handle events for widgets and panels. You can use event listeners to check when something important happens, like a UI element closing or a file uploading. Events unique to a widget or panel are documented on its page.
Add an event listener
To add an event listener, callĀ aiware.on().
aiware.on('event', function() {
});
Parameters
The parameters of on() are:
| Name | Required | Type | Description |
|---|
| event | True | String | The event to listen for. |
| callback | True | Function | The callback to run. |
Remove an event listener
To remove an event listener, call aiware.off().
aiware.off('event');
Parameters
The parameters of off() are:
| Name | Required | Type | Description |
|---|
| event | True | String | The event to stop listening for. |