Interface

FormEvent

@ng-forge/dynamic-forms

Base interface for all form events in the dynamic form system.

All form events must implement this interface to be compatible with the event bus system. The type property is used for event filtering and type-safe subscriptions.

Signature

interface FormEvent

Properties

NameTypeDescription
type stringUnique identifier for the event type used for filtering and subscriptions
formValue ?unknown

Optional form value attached to the event when withEventFormValue() is enabled or options.emitFormValueOnEvents is set to true in the form config.

Use the hasFormValue() type guard to check if this property is present.

Examples

export class SubmitEvent implements FormEvent {
  readonly type = 'submit';
}

export class ValidationErrorEvent implements FormEvent {
  readonly type = 'validation-error';
  constructor(public errors: ValidationErrors) {}
}