An abstract base class for widget directives, providing common functionality for Angular components that interact with widgets.
W extends Widget
The type of the widget.
get api():
W["api"]
Retrieves the widget api
W["api"]
the widget api
get directives():
W["directives"]
Retrieves the widget directives
W["directives"]
the widget directives
get state():
AngularState<W>
Retrieves the widget state. Each property of the state is exposed through an Angular Signal
AngularState<W>
the widget state
callWidgetFactoryWithConfig<
W>(factory,options?):AngularWidget<W>
Call a widget factory using provided configs.
The resulting widget can be easily hooked into the lifecycle of an Angular component through BaseWidgetDirective.
W extends Widget<object, object, object, object>
the widget factory to call
the options
(widget) => void
a callback to call after successful setup of the widget
Partial<WidgetProps<W>> | ReadableSignal<undefined | Partial<WidgetProps<W>>>
the default config of the widget
Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & on${string} >>
the events of the widget
() => undefined | TemplateRef<void>
a function to provide the default children slot using a view query
() => { [K in string | number | symbol as IsSlotContent<WidgetProps<W>[K]> extends 0 ? never : K]: WidgetProps<W>[K] extends SlotContent<U> ? undefined | TemplateRef<U> : never }
a function to provide all slot templates using child queries
null | ReadableSignal<undefined | Partial<WidgetProps<W>>>
the config of the widget, overriding the defaultConfig
the widget
createWidgetFactory<
W,T>(widgetName,factory):WidgetFactory<W,T>
Define a widget factory that can be linked with configuration through the provided widget name.
W extends Widget<object, object, object, object>
The type of the widget
T extends (config?) => W = (config?) => W
The type of the widget factory function. Useful when the widget factory has a generic.
string
the widget name, used for configuration injection
T
the widget factory function
WidgetFactory<W, T>
the widget factory