This is documentation for Stream Chat Angular SDK v4, which is nolonger actively maintained. For up-to-date documentation, see the latest version (v5).

NotificationService

The 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 in

lib/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 parameters

NameType
T{ [key: string]: any; }

Parameters

NameTypeDefault valueDescription
contentstring | TemplateRef<T>undefinedThe text of the notification or the HTML template for the notification
typeNotificationType'error'The type of the notification
translateParams?ObjectundefinedTranslation parameters for the content (for text notifications)
templateContext?TundefinedThe input of the notification template (for HTML notifications)

Returns

fn

A method to clear the notification.

▸ (): void

Returns

void

Defined in

lib/notification.service.ts:68


addTemporaryNotification

addTemporaryNotification<T>(content, type?, timeout?, translateParams?, templateContext?): () => void

Displays a notification for the given amount of time.

Type parameters

Name
T

Parameters

NameTypeDefault valueDescription
contentstring | TemplateRef<T>undefinedThe text of the notification or the HTML template for the notification
typeNotificationType'error'The type of the notification
timeoutnumber5000The number of milliseconds while the notification should be visible
translateParams?ObjectundefinedTranslation parameters for the content (for text notifications)
templateContext?TundefinedThe input of the notification template (for HTML notifications)

Returns

fn

A method to clear the notification (before the timeout).

▸ (): void

Returns

void

Defined in

lib/notification.service.ts:31

© Getstream.io, Inc. All Rights Reserved.