@microsoft/fast-element > ElementController > emit
ElementController.emit() method
Emits a custom HTML event.
Signature:
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
type |
string |
The type name of the event. |
|
detail |
any |
(Optional) The event detail object to send with the event. |
|
options |
Omit<CustomEventInit, "detail"> |
(Optional) The event options. By default bubbles and composed. |
Returns:
void | boolean
Remarks
Only emits events if connected.