#
NotificationServiceThe NotificationService
can be used to add or remove notifications. By default the NotificationList
component displays the currently active notifications.
#
Properties#
notifications$• notifications$: Observable
<NotificationPayload
<{}>[]>
Emits the currently active notifications.
#
Defined inlib/notification.service.ts:15
#
Methods#
addPermanentNotification▸ addPermanentNotification<T
>(content
, type?
, translateParams?
, templateContext?
): () => void
Displays a notification, that will be visible until it's removed.
#
Type parametersName | Type |
---|---|
T | { [key: string]: any ; } |
#
ParametersName | Type | Default value | Description |
---|---|---|---|
content | string | TemplateRef <T > | undefined | The text of the notification or the HTML template for the notification |
type | NotificationType | 'error' | The type of the notification |
translateParams? | Object | undefined | Translation parameters for the content (for text notifications) |
templateContext? | T | undefined | The input of the notification template (for HTML notifications) |
#
Returnsfn
A method to clear the notification.
▸ (): void
#
Returnsvoid
#
Defined inlib/notification.service.ts:68
#
addTemporaryNotification▸ addTemporaryNotification<T
>(content
, type?
, timeout?
, translateParams?
, templateContext?
): () => void
Displays a notification for the given amount of time.
#
Type parametersName |
---|
T |
#
ParametersName | Type | Default value | Description |
---|---|---|---|
content | string | TemplateRef <T > | undefined | The text of the notification or the HTML template for the notification |
type | NotificationType | 'error' | The type of the notification |
timeout | number | 5000 | The number of milliseconds while the notification should be visible |
translateParams? | Object | undefined | Translation parameters for the content (for text notifications) |
templateContext? | T | undefined | The input of the notification template (for HTML notifications) |
#
Returnsfn
A method to clear the notification (before the timeout).
▸ (): void
#
Returnsvoid