Class
FormClearEvent
@ng-forge/dynamic-forms
Event dispatched when the form should be cleared.
This event instructs the dynamic form component to clear all field values, resetting them to empty/undefined state regardless of their default values.
Signature
class FormClearEvent
implements FormEventProperties
| Name | Type | Description |
|---|---|---|
type | "form-clear" | - |
Examples
// Dispatch from a button component
eventBus.dispatch(FormClearEvent);// Listen for clear events
eventBus.on<FormClearEvent>('form-clear').subscribe(() => {
console.log('Form was cleared');
});packages/dynamic-forms/src/lib/events/constants/form-clear.event.ts:23