Represents the API for an alert component.
close():
void
Triggers alert closing programmatically (same as clicking on the close button (×)).
void
open():
void
Triggers the alert to be displayed for the user.
void
Directive to be used as a structural directive for the body of an alert component.
This directive allows the use of a template reference for the alert body content, with type AlertContext.
AlertComponent is a UI component that extends BaseWidgetDirective to provide an alert box with various customizable properties and behaviors.
This component is designed to be used with Bootstrap styles and supports various Bootstrap contextual classes for different alert types.
animated:
undefined
|boolean
If true
, alert closing will be animated.
Animation is triggered when clicked on the close button (×),
via the .close()
function or the visible prop is changed
true
animatedOnInit:
undefined
|boolean
If true
, alert opening will be animated.
Animation is triggered when the .open()
function is called
or the visible prop is changed
false
ariaCloseButtonLabel:
undefined
|string
Accessibility close button label
'Close'
children:
SlotContent
<AlertContext
>
Template for the alert content
className:
undefined
|string
CSS classes to be applied on the widget main container
''
dismissible:
undefined
|boolean
If true
, alert can be dismissed by the user.
The close button (×) will be displayed and you can be notified of the event with the (close) output.
true
hidden:
EventEmitter
<void
>
Callback called when the alert is hidden.
() => {}
shown:
EventEmitter
<void
>
Callback called when the alert is shown.
() => {}
structure:
SlotContent
<AlertContext
>
Global template for the alert component
transition:
undefined
|TransitionFn
The transition function will be executed when the alert is displayed or hidden.
Depending on the value of animatedOnInit
, the animation can be optionally skipped during the showing process.
fadeTransition
type:
undefined
|BSContextualClass
Type of the alert, following bootstrap types.
'primary'
visible:
undefined
|boolean
If true
the alert is visible to the user
true
visibleChange:
EventEmitter
<boolean
>
Callback called when the alert visibility changed.
() => {}
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 as an Angular Signal
AngularState
<W
>
the widget state
Represents the context for an Alert component.
api:
AlertApi
all the api functions to interact with the widget
directives:
AlertDirectives
directives to be used on html elements in the template of the widget or in the slots
state:
AngularState
<AlertWidget
>
the state of the widget
const
alertDefaultSlotStructure:SlotContent
<AlertContext
>
Represents the default slot structure for the alert component.
Represents the directives for an alert component.
transitionDirective:
Directive
the transition directive, piloting what is the visual effect of going from hidden to visible
Represents the properties for the Alert component.
animated:
boolean
If true
, alert closing will be animated.
Animation is triggered when clicked on the close button (×),
via the .close()
function or the visible prop is changed
true
animatedOnInit:
boolean
If true
, alert opening will be animated.
Animation is triggered when the .open()
function is called
or the visible prop is changed
false
ariaCloseButtonLabel:
string
Accessibility close button label
'Close'
children:
SlotContent
<AlertContext
>
Template for the alert content
className:
string
CSS classes to be applied on the widget main container
''
dismissible:
boolean
If true
, alert can be dismissed by the user.
The close button (×) will be displayed and you can be notified of the event with the (close) output.
true
onHidden: () =>
void
Callback called when the alert is hidden.
void
() => {}
onShown: () =>
void
Callback called when the alert is shown.
void
() => {}
onVisibleChange: (
visible
) =>void
Callback called when the alert visibility changed.
• visible: boolean
void
() => {}
structure:
SlotContent
<AlertContext
>
Global template for the alert component
transition:
TransitionFn
The transition function will be executed when the alert is displayed or hidden.
Depending on the value of animatedOnInit
, the animation can be optionally skipped during the showing process.
fadeTransition
type:
BSContextualClass
Type of the alert, following bootstrap types.
'primary'
visible:
boolean
If true
the alert is visible to the user
true
Represents the state of an alert component.
ariaCloseButtonLabel:
string
Accessibility close button label
'Close'
children:
SlotContent
<AlertContext
>
Template for the alert content
className:
string
CSS classes to be applied on the widget main container
''
dismissible:
boolean
If true
, alert can be dismissed by the user.
The close button (×) will be displayed and you can be notified of the event with the (close) output.
true
hidden:
boolean
Is true
when the alert is hidden. Compared to visible
, this is updated after the transition is executed.
structure:
SlotContent
<AlertContext
>
Global template for the alert component
type:
BSContextualClass
Type of the alert, following bootstrap types.
'primary'
visible:
boolean
If true
the alert is visible to the user
true
Directive to define the structure of an alert component.
This directive uses a TemplateRef
to inject the template reference of the AlertContext.
AlertWidget:
Widget
<AlertProps
,AlertState
,AlertApi
,AlertDirectives
>
Represents an alert widget component.
createAlert(
props
?):AlertWidget
Create an AlertWidget with given config props
• props?: PropsConfig
<AlertProps
>
an AlertWidget
getAlertDefaultConfig():
AlertProps
Retrieve a shallow copy of the default Alert config
the default Alert config