Bootstrap

API widget

BaseWidgetDirective

class

An abstract base class for widget directives, providing common functionality for Angular components that interact with widgets.

Extended by
Type Parameters

W extends Widget

The type of the widget.

Implements
Accessors
api
Get Signature

get api(): W["api"]

Retrieves the widget api

Returns

W["api"]

the widget api


directives
Get Signature

get directives(): W["directives"]

Retrieves the widget directives

Returns

W["directives"]

the widget directives


state
Get Signature

get state(): AngularState<W>

Retrieves the widget state. Each property of the state is exposed through an Angular Signal

Returns

AngularState<W>

the widget state


callWidgetFactoryWithConfig

function

callWidgetFactoryWithConfig<W>(parameter): AngularWidget<W>

Call a widget factory using provided configs.

Type Parameters

W extends Widget<object, object, object, object>

Parameters
parameter

the parameter

afterInit

(widget) => void

a callback to call after successful setup of the widget

defaultConfig

Partial<WidgetProps<W>> | ReadableSignal<undefined | Partial<WidgetProps<W>>>

the default config of the widget

events

Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>

the events of the widget

factory

WidgetFactory<W>

the widget factory to call

slotChildren

() => undefined | TemplateRef<void>

a function to provide the default children slot using a view query

slotTemplates

() => { [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

widgetConfig

null | ReadableSignal<undefined | Partial<WidgetProps<W>>>

the config of the widget, overriding the defaultConfig

Returns

AngularWidget<W>

the widget