# NotificationService

The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/v6/components/NotificationListComponent/) component displays the currently active notifications.

## Properties

### notifications$

**notifications$**: `Observable`<`NotificationPayload`\<`object`\>[]\>

Emits the currently active [notifications](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/notification.service.ts).

#### Defined in

[projects/stream-chat-angular/src/lib/notification.service.ts:15](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/notification.service.ts#L15)

## Methods

### addPermanentNotification

**addPermanentNotification**\<`T`\>(`content`, `type?`, `translateParams?`, `templateContext?`): () => `void`

Displays a notification, that will be visible until it's removed.

#### Type parameters

| Name | Type     |
| :--- | :------- |
| `T`  | `object` |

#### Parameters

| Name               | 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)        |

#### Returns

`fn`

A method to clear the notification.

(): `void`

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/notification.service.ts:68](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/notification.service.ts#L68)

---

### addTemporaryNotification

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

Displays a notification for the given amount of time.

#### Type parameters

| Name |
| :--- |
| `T`  |

#### Parameters

| Name               | 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)        |

#### Returns

`fn`

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

(): `void`

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/notification.service.ts:31](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/notification.service.ts#L31)

---

This page was last updated at 2025-11-25T16:21:26.335Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/angular/v6/services/NotificationService/](https://getstream.io/chat/docs/sdk/angular/v6/services/NotificationService/).