# ChannelService

The `ChannelService` provides data and interaction for the channel list and message list.

## Properties

### activeChannel$

**activeChannel$**: `Observable<undefined | Channel>`

Emits the currently active channel.

:::important
If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail.
:::

The active channel will always be marked as read when a new message is received

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:79](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L79)

---

### activeChannelLastReadMessageId

`Optional` **activeChannelLastReadMessageId**: `string`

The last read message id of the active channel, it's used by the message list component to display unread UI, and jump to latest read message

This property isn't always updated, please use `channel.read` to display up-to-date read information

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:131](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L131)

---

### activeChannelMessages$

**activeChannelMessages$**: `Observable<StreamMessage[]>`

Emits the list of currently loaded messages of the active channel.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:83](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L83)

---

### activeChannelPinnedMessages$

**activeChannelPinnedMessages$**: `Observable<StreamMessage[]>`

Emits the list of pinned messages of the active channel.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:87](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L87)

---

### activeChannelUnreadCount

`Optional` **activeChannelUnreadCount**: `number`

The unread count of the active channel, it's used by the message list component to display unread UI

This property isn't always updated, please use `channel.read` to display up-to-date read information

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:137](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L137)

---

### activeParentMessage$

**activeParentMessage$**: `Observable<undefined | StreamMessage>`

Emits the currently selected parent message. If no message is selected, it emits undefined.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:99](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L99)

---

### activeParentMessageId$

**activeParentMessageId$**: `Observable<undefined | string>`

Emits the id of the currently selected parent message. If no message is selected, it emits undefined.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:91](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L91)

---

### activeThreadMessages$

**activeThreadMessages$**: `Observable<StreamMessage[]>`

Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:95](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L95)

---

### beforeSendMessage

`Optional` **beforeSendMessage**: (`input`: `MessageInput`) => `MessageInput` \| `Promise<MessageInput>`

The provided method will be called before a new message is sent to Stream's API. You can use this hook to tranfrom or enrich the message being sent.

#### Type declaration

(`input`): `MessageInput` \| `Promise<MessageInput>`

##### Parameters

| Name    | Type           |
| :------ | :------------- |
| `input` | `MessageInput` |

##### Returns

`MessageInput` \| `Promise<MessageInput>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:301](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L301)

---

### beforeUpdateMessage

`Optional` **beforeUpdateMessage**: (`message`: `StreamMessage`) => `StreamMessage` \| `Promise<StreamMessage>`

The provided method will be called before a message is sent to Stream's API for update. You can use this hook to tranfrom or enrich the message being updated.

#### Type declaration

(`message`): `StreamMessage` \| `Promise<StreamMessage>`

##### Parameters

| Name      | Type            |
| :-------- | :-------------- |
| `message` | `StreamMessage` |

##### Returns

`StreamMessage` \| `Promise<StreamMessage>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:307](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L307)

---

### bouncedMessage$

**bouncedMessage$**: `BehaviorSubject<undefined | StreamMessage>`

If you're using [semantic filters for moderation](/moderation/docs/node/) you can set up rules for bouncing messages.

If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:125](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L125)

---

### channelQueryState$

**channelQueryState$**: `Observable<undefined | ChannelQueryState>`

The result of the latest channel query request.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:69](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L69)

---

### channelSwitchState$

**channelSwitchState$**: `Observable<"end" | "start">`

Since switching channels changes the state of multiple obserables, this observable can be used to check if all observables are updated.

- `end` means all observables are in stable state
- `start` means all observables are in unstable state

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:315](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L315)

---

### channels$

**channels$**: `Observable<undefined | Channel[]>`

Emits the currently loaded and [watched](/chat/docs/javascript/creating_channels/) channel list.

:::important
If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail.
:::

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:65](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L65)

---

### customAddedToChannelNotificationHandler

`Optional` **customAddedToChannelNotificationHandler**: (`clientEvent`: `ClientEvent`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`) => `void`

Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`clientEvent`, `channelListSetter`): `void`

##### Parameters

| Name                | Type                                                                                 |
| :------------------ | :----------------------------------------------------------------------------------- |
| `clientEvent`       | `ClientEvent`                                                                        |
| `channelListSetter` | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:155](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L155)

---

### customChannelDeletedHandler

`Optional` **customChannelDeletedHandler**: (`event`: `Event`, `channel`: `Channel`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`, `messageListSetter`: (`messages`: `StreamMessage`[]) => `void`, `threadListSetter`: (`messages`: `StreamMessage`[]) => `void`, `parentMessageSetter`: (`message`: `undefined` \| `StreamMessage`) => `void`) => `void`

Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`event`, `channel`, `channelListSetter`, `messageListSetter`, `threadListSetter`, `parentMessageSetter`): `void`

##### Parameters

| Name                  | Type                                                                                 |
| :-------------------- | :----------------------------------------------------------------------------------- |
| `event`               | `Event`                                                                              |
| `channel`             | `Channel`                                                                            |
| `channelListSetter`   | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |
| `messageListSetter`   | (`messages`: `StreamMessage`[]) => `void`                                            |
| `threadListSetter`    | (`messages`: `StreamMessage`[]) => `void`                                            |
| `parentMessageSetter` | (`message`: `undefined` \| `StreamMessage`) => `void`                                |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:179](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L179)

---

### customChannelHiddenHandler

`Optional` **customChannelHiddenHandler**: (`event`: `Event`, `channel`: `Channel`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`, `messageListSetter`: (`messages`: `StreamMessage`[]) => `void`, `threadListSetter`: (`messages`: `StreamMessage`[]) => `void`, `parentMessageSetter`: (`message`: `undefined` \| `StreamMessage`) => `void`) => `void`

Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`event`, `channel`, `channelListSetter`, `messageListSetter`, `threadListSetter`, `parentMessageSetter`): `void`

##### Parameters

| Name                  | Type                                                                                 |
| :-------------------- | :----------------------------------------------------------------------------------- |
| `event`               | `Event`                                                                              |
| `channel`             | `Channel`                                                                            |
| `channelListSetter`   | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |
| `messageListSetter`   | (`messages`: `StreamMessage`[]) => `void`                                            |
| `threadListSetter`    | (`messages`: `StreamMessage`[]) => `void`                                            |
| `parentMessageSetter` | (`message`: `undefined` \| `StreamMessage`) => `void`                                |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:227](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L227)

---

### customChannelTruncatedHandler

`Optional` **customChannelTruncatedHandler**: (`event`: `Event`, `channel`: `Channel`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`, `messageListSetter`: (`messages`: `StreamMessage`[]) => `void`, `threadListSetter`: (`messages`: `StreamMessage`[]) => `void`, `parentMessageSetter`: (`message`: `undefined` \| `StreamMessage`) => `void`) => `void`

Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`event`, `channel`, `channelListSetter`, `messageListSetter`, `threadListSetter`, `parentMessageSetter`): `void`

##### Parameters

| Name                  | Type                                                                                 |
| :-------------------- | :----------------------------------------------------------------------------------- |
| `event`               | `Event`                                                                              |
| `channel`             | `Channel`                                                                            |
| `channelListSetter`   | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |
| `messageListSetter`   | (`messages`: `StreamMessage`[]) => `void`                                            |
| `threadListSetter`    | (`messages`: `StreamMessage`[]) => `void`                                            |
| `parentMessageSetter` | (`message`: `undefined` \| `StreamMessage`) => `void`                                |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:211](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L211)

---

### customChannelUpdatedHandler

`Optional` **customChannelUpdatedHandler**: (`event`: `Event`, `channel`: `Channel`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`, `messageListSetter`: (`messages`: `StreamMessage`[]) => `void`, `threadListSetter`: (`messages`: `StreamMessage`[]) => `void`, `parentMessageSetter`: (`message`: `undefined` \| `StreamMessage`) => `void`) => `void`

Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`event`, `channel`, `channelListSetter`, `messageListSetter`, `threadListSetter`, `parentMessageSetter`): `void`

##### Parameters

| Name                  | Type                                                                                 |
| :-------------------- | :----------------------------------------------------------------------------------- |
| `event`               | `Event`                                                                              |
| `channel`             | `Channel`                                                                            |
| `channelListSetter`   | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |
| `messageListSetter`   | (`messages`: `StreamMessage`[]) => `void`                                            |
| `threadListSetter`    | (`messages`: `StreamMessage`[]) => `void`                                            |
| `parentMessageSetter` | (`message`: `undefined` \| `StreamMessage`) => `void`                                |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:195](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L195)

---

### customChannelVisibleHandler

`Optional` **customChannelVisibleHandler**: (`event`: `Event`, `channel`: `Channel`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`, `messageListSetter`: (`messages`: `StreamMessage`[]) => `void`, `threadListSetter`: (`messages`: `StreamMessage`[]) => `void`, `parentMessageSetter`: (`message`: `undefined` \| `StreamMessage`) => `void`) => `void`

Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`event`, `channel`, `channelListSetter`, `messageListSetter`, `threadListSetter`, `parentMessageSetter`): `void`

##### Parameters

| Name                  | Type                                                                                 |
| :-------------------- | :----------------------------------------------------------------------------------- |
| `event`               | `Event`                                                                              |
| `channel`             | `Channel`                                                                            |
| `channelListSetter`   | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |
| `messageListSetter`   | (`messages`: `StreamMessage`[]) => `void`                                            |
| `threadListSetter`    | (`messages`: `StreamMessage`[]) => `void`                                            |
| `parentMessageSetter` | (`message`: `undefined` \| `StreamMessage`) => `void`                                |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:243](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L243)

---

### customFileDeleteRequest

`Optional` **customFileDeleteRequest**: (`url`: `string`, `channel`: `Channel`) => `Promise<void>`

You can override the default file delete request - override this if you use your own CDN

#### Type declaration

(`url`, `channel`): `Promise<void>`

##### Parameters

| Name      | Type      |
| :-------- | :-------- |
| `url`     | `string`  |
| `channel` | `Channel` |

##### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:287](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L287)

---

### customFileUploadRequest

`Optional` **customFileUploadRequest**: (`file`: `File`, `channel`: `Channel`) => `Promise<{ file: string }>`

You can override the default file upload request - you can use this to upload files to your own CDN

#### Type declaration

(`file`, `channel`): `Promise<{ file: string }>`

##### Parameters

| Name      | Type      |
| :-------- | :-------- |
| `file`    | `File`    |
| `channel` | `Channel` |

##### Returns

`Promise<{ file: string }>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:273](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L273)

---

### customImageDeleteRequest

`Optional` **customImageDeleteRequest**: (`url`: `string`, `channel`: `Channel`) => `Promise<void>`

You can override the default image delete request - override this if you use your own CDN

#### Type declaration

(`url`, `channel`): `Promise<void>`

##### Parameters

| Name      | Type      |
| :-------- | :-------- |
| `url`     | `string`  |
| `channel` | `Channel` |

##### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:291](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L291)

---

### customImageUploadRequest

`Optional` **customImageUploadRequest**: (`file`: `File`, `channel`: `Channel`) => `Promise<{ file: string }>`

You can override the default image upload request - you can use this to upload images to your own CDN

#### Type declaration

(`file`, `channel`): `Promise<{ file: string }>`

##### Parameters

| Name      | Type      |
| :-------- | :-------- |
| `file`    | `File`    |
| `channel` | `Channel` |

##### Returns

`Promise<{ file: string }>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:280](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L280)

---

### customNewMessageHandler

`Optional` **customNewMessageHandler**: (`event`: `Event`, `channel`: `Channel`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`, `messageListSetter`: (`messages`: `StreamMessage`[]) => `void`, `threadListSetter`: (`messages`: `StreamMessage`[]) => `void`, `parentMessageSetter`: (`message`: `undefined` \| `StreamMessage`) => `void`) => `void`

Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`event`, `channel`, `channelListSetter`, `messageListSetter`, `threadListSetter`, `parentMessageSetter`): `void`

##### Parameters

| Name                  | Type                                                                                 |
| :-------------------- | :----------------------------------------------------------------------------------- |
| `event`               | `Event`                                                                              |
| `channel`             | `Channel`                                                                            |
| `channelListSetter`   | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |
| `messageListSetter`   | (`messages`: `StreamMessage`[]) => `void`                                            |
| `threadListSetter`    | (`messages`: `StreamMessage`[]) => `void`                                            |
| `parentMessageSetter` | (`message`: `undefined` \| `StreamMessage`) => `void`                                |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:259](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L259)

---

### customNewMessageNotificationHandler

`Optional` **customNewMessageNotificationHandler**: (`clientEvent`: `ClientEvent`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`) => `void`

Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/)

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`clientEvent`, `channelListSetter`): `void`

##### Parameters

| Name                | Type                                                                                 |
| :------------------ | :----------------------------------------------------------------------------------- |
| `clientEvent`       | `ClientEvent`                                                                        |
| `channelListSetter` | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:143](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L143)

---

### customRemovedFromChannelNotificationHandler

`Optional` **customRemovedFromChannelNotificationHandler**: (`clientEvent`: `ClientEvent`, `channelListSetter`: (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void`) => `void`

Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).

If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/creating_channels/) channel.

#### Type declaration

(`clientEvent`, `channelListSetter`): `void`

##### Parameters

| Name                | Type                                                                                 |
| :------------------ | :----------------------------------------------------------------------------------- |
| `clientEvent`       | `ClientEvent`                                                                        |
| `channelListSetter` | (`channels`: `Channel`[], `shouldStopWatchingRemovedChannels?`: `boolean`) => `void` |

##### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:167](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L167)

---

### hasMoreChannels$

**hasMoreChannels$**: `Observable<boolean>`

Emits `false` if there are no more pages of channels that can be loaded.

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:57](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L57)

---

### isMessageLoadingInProgress

**isMessageLoadingInProgress**: `boolean` = `false`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:323](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L323)

---

### jumpToMessage$

**jumpToMessage$**: `Observable<{ id?: string ; parentId?: string }>`

Emits the ID of the message the message list should jump to (can be a channel message or thread message)

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:107](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L107)

---

### latestMessageDateByUserByChannels$

**latestMessageDateByUserByChannels$**: `Observable<{ [key: string]: Date; }>`

Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:119](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L119)

---

### messageDeleteConfirmationHandler

`Optional` **messageDeleteConfirmationHandler**: (`message`: `StreamMessage`) => `Promise<boolean>`

The provided method will be called before deleting a message. If the returned Promise resolves to `true` to deletion will go ahead. If `false` is returned, the message won't be deleted.

#### Type declaration

(`message`): `Promise<boolean>`

##### Parameters

| Name      | Type            |
| :-------- | :-------------- |
| `message` | `StreamMessage` |

##### Returns

`Promise<boolean>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:295](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L295)

---

### messageToQuote$

**messageToQuote$**: `Observable<undefined | StreamMessage>`

Emits the currently selected message to quote

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:103](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L103)

---

### usersTypingInChannel$

**usersTypingInChannel$**: `Observable<UserResponse[]>`

Emits the list of users that are currently typing in the channel (current user is not included)

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:111](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L111)

---

### usersTypingInThread$

**usersTypingInThread$**: `Observable<UserResponse[]>`

Emits the list of users that are currently typing in the active thread (current user is not included)

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:115](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L115)

---

### MAX_MESSAGE_REACTIONS_TO_FETCH

▪ `Static` `Readonly` **MAX_MESSAGE_REACTIONS_TO_FETCH**: `1200`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:319](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L319)

## Accessors

### activeChannel

`get` **activeChannel**(): `undefined` \| `Channel`

The current active channel

#### Returns

`undefined` \| `Channel`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1663](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1663)

---

### activeChannelMessages

`get` **activeChannelMessages**(): (`MessageResponse` \| `LocalMessage` \| `StreamMessage`)[]

The current active channel messages

#### Returns

(`MessageResponse` \| `LocalMessage` \| `StreamMessage`)[]

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1670](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1670)

---

### activeChannelThreadReplies

`get` **activeChannelThreadReplies**(): (`MessageResponse` \| `LocalMessage` \| `StreamMessage`)[]

The current thread replies

#### Returns

(`MessageResponse` \| `LocalMessage` \| `StreamMessage`)[]

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1677](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1677)

---

### channels

`get` **channels**(): `Channel`[]

The current list of channels

#### Returns

`Channel`[]

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1656](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1656)

---

### customPaginator

`set` **customPaginator**(`paginator`): `void`

By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method.

The method will be called with the result of the latest channel query.

You can return either an offset, or a filter using the [`$lte`/`$gte` operator](/chat/docs/javascript/query_syntax_operators/). If you return a filter, it will be merged with the filter provided for the `init` method.

#### Parameters

| Name        | Type                                                                          |
| :---------- | :---------------------------------------------------------------------------- |
| `paginator` | `undefined` \| (`channelQueryResult`: `Channel`[]) => `NextPageConfiguration` |

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:555](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L555)

---

### shouldMarkActiveChannelAsRead

`get` **shouldMarkActiveChannelAsRead**(): `boolean`

If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.

#### Returns

`boolean`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:531](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L531)

`set` **shouldMarkActiveChannelAsRead**(`shouldMarkActiveChannelAsRead`): `void`

If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.

#### Parameters

| Name                            | Type      |
| :------------------------------ | :-------- |
| `shouldMarkActiveChannelAsRead` | `boolean` |

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:538](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L538)

## Methods

### addChannel

**addChannel**(`channel`): `void`

Add a new channel to the channel list
The channel will be added to the beginning of the channel list

#### Parameters

| Name      | Type      |
| :-------- | :-------- |
| `channel` | `Channel` |

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1169](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1169)

---

### addReaction

**addReaction**(`messageId`, `reactionType`, `customData?`): `Promise<void>`

Adds a reaction to a message.

#### Parameters

| Name           | Type                 | Description                                  |
| :------------- | :------------------- | :------------------------------------------- |
| `messageId`    | `string`             | The id of the message to add the reaction to |
| `reactionType` | `string`             | The type of the reaction                     |
| `customData?`  | `CustomReactionData` |                                              |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:820](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L820)

---

### autocompleteMembers

**autocompleteMembers**(`searchTerm`): `Promise<ChannelMemberResponse[]>`

Returns the autocomplete options for current channel members. If the channel has less than 100 members, it returns the channel members, otherwise sends a [search request](/chat/docs/javascript/query_members/#pagination-and-ordering) with the given search term.

#### Parameters

| Name         | Type     | Description                                |
| :----------- | :------- | :----------------------------------------- |
| `searchTerm` | `string` | Text to search for in the names of members |

#### Returns

`Promise<ChannelMemberResponse[]>`

The list of members matching the search filter

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1091](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1091)

---

### clearMessageJump

**clearMessageJump**(): `void`

Clears the currently selected message to jump

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1337](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1337)

---

### deleteAttachment

**deleteAttachment**(`attachmentUpload`): `Promise<void>`

Deletes an uploaded file by URL. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation

#### Parameters

| Name               | Type               | Description                                                                                                        |
| :----------------- | :----------------- | :----------------------------------------------------------------------------------------------------------------- |
| `attachmentUpload` | `AttachmentUpload` | Attachment to be deleted (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/)) |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1075](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1075)

---

### deleteMessage

**deleteMessage**(`message`, `isLocalDelete?`): `Promise<void>`

Deletes the message from the active channel

#### Parameters

| Name            | Type            | Default value | Description                                                                                                       |
| :-------------- | :-------------- | :------------ | :---------------------------------------------------------------------------------------------------------------- |
| `message`       | `StreamMessage` | `undefined`   | Message to be deleted                                                                                             |
| `isLocalDelete` | `boolean`       | `false`       | set this `true` if you want to delete a message that's only part of the local state, not yet saved on the backend |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:963](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L963)

---

### deselectActiveChannel

**deselectActiveChannel**(): `void`

Deselects the currently active (if any) channel

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:607](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L607)

---

### getMessageReactions

**getMessageReactions**(`messageId`): `Promise<ReactionResponse[]>`

Get the last 1200 reactions of a message in the current active channel. If you need to fetch more reactions please use the [following endpoint](/chat/docs/javascript/send_reaction/#paginating-reactions).

#### Parameters

| Name        | Type     |
| :---------- | :------- |
| `messageId` | `string` |

#### Returns

`Promise<ReactionResponse[]>`

all reactions of a message

**`Deprecated`**

use [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) instead

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1687](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1687)

---

### init

**init**(`filters`, `sort?`, `options?`, `shouldSetActiveChannel?`): `Promise<Channel[]>`

Queries the channels with the given filters, sorts and options. More info about [channel querying](/chat/docs/javascript/query_channels/) can be found in the platform documentation. By default the first channel in the list will be set as active channel and will be marked as read.

#### Parameters

| Name                     | Type             | Default value | Description                                                                            |
| :----------------------- | :--------------- | :------------ | :------------------------------------------------------------------------------------- |
| `filters`                | `ChannelFilters` | `undefined`   |                                                                                        |
| `sort?`                  | `ChannelSort`    | `undefined`   |                                                                                        |
| `options?`               | `ChannelOptions` | `undefined`   |                                                                                        |
| `shouldSetActiveChannel` | `boolean`        | `true`        | Decides if the first channel in the result should be made as an active channel or not. |

#### Returns

`Promise<Channel[]>`

the list of channels found by the query

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:744](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L744)

---

### initWithCustomQuery

**initWithCustomQuery**(`query`, `options?`): `Promise<Channel[]>`

Queries the channels with the given query function. More info about [channel querying](/chat/docs/javascript/query_channels/) can be found in the platform documentation.

#### Parameters

| Name                             | Type                                                               | Description                                                                                                                                   |
| :------------------------------- | :----------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`                          | (`queryType`: `ChannelQueryType`) => `Promise<ChannelQueryResult>` |                                                                                                                                               |
| `options`                        | `Object`                                                           |                                                                                                                                               |
| `options.messagePageSize`        | `number`                                                           | How many messages should we load? The default is 25                                                                                           |
| `options.shouldSetActiveChannel` | `boolean`                                                          | The `shouldSetActiveChannel` specifies if the first channel in the result should be selected as the active channel or not. Default is `true`. |

#### Returns

`Promise<Channel[]>`

the channels that were loaded

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:780](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L780)

---

### jumpToMessage

**jumpToMessage**(`messageId`, `parentMessageId?`): `Promise<void>`

Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.

#### Parameters

| Name               | Type     | Description                                                                    |
| :----------------- | :------- | :----------------------------------------------------------------------------- |
| `messageId`        | `string` | The ID of the message to be loaded, 'latest' means jump to the latest messages |
| `parentMessageId?` | `string` | The ID of the parent message if we want to load a thread message               |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1303](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1303)

---

### loadMoreChannels

**loadMoreChannels**(): `Promise<void>`

Loads the next page of channels. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:810](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L810)

---

### loadMoreMessages

**loadMoreMessages**(`direction?`): `undefined` \| `false` \| `Promise<QueryChannelAPIResponse>`

Loads the next page of messages of the active channel. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.

#### Parameters

| Name        | Type                   | Default value |
| :---------- | :--------------------- | :------------ |
| `direction` | `"older"` \| `"newer"` | `'older'`     |

#### Returns

`undefined` \| `false` \| `Promise<QueryChannelAPIResponse>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:672](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L672)

---

### loadMoreThreadReplies

**loadMoreThreadReplies**(`direction?`): `false` \| `Promise<void>`

Loads the next page of messages of the active thread. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.

#### Parameters

| Name        | Type                   | Default value |
| :---------- | :--------------------- | :------------ |
| `direction` | `"older"` \| `"newer"` | `'older'`     |

#### Returns

`false` \| `Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:711](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L711)

---

### markMessageUnread

**markMessageUnread**(`messageId`): `Promise<undefined | null | APIResponse>`

Marks the channel from the given message as unread

#### Parameters

| Name        | Type     |
| :---------- | :------- |
| `messageId` | `string` |

#### Returns

`Promise<undefined | null | APIResponse>`

the result of the request

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1720](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1720)

---

### pinMessage

**pinMessage**(`message`): `Promise<void>`

Pins the given message in the channel

#### Parameters

| Name      | Type            |
| :-------- | :-------------- |
| `message` | `StreamMessage` |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1345](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1345)

---

### removeChannel

**removeChannel**(`cid`, `shouldStopWatching?`): `void`

#### Parameters

| Name                 | Type      | Default value |
| :------------------- | :-------- | :------------ |
| `cid`                | `string`  | `undefined`   |
| `shouldStopWatching` | `boolean` | `true`        |

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1181](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1181)

---

### removeReaction

**removeReaction**(`messageId`, `reactionType`): `Promise<void>`

Removes a reaction from a message.

#### Parameters

| Name           | Type     | Description                                       |
| :------------- | :------- | :------------------------------------------------ |
| `messageId`    | `string` | The id of the message to remove the reaction from |
| `reactionType` | `string` | Thr type of reaction to remove                    |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:836](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L836)

---

### resendMessage

**resendMessage**(`message`): `Promise<StreamMessage>`

Resends the given message to the active channel

#### Parameters

| Name      | Type            | Description           |
| :-------- | :-------------- | :-------------------- |
| `message` | `StreamMessage` | The message to resend |

#### Returns

`Promise<StreamMessage>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:893](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L893)

---

### reset

**reset**(): `void`

Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](/chat/docs/sdk/angular/services/ChatClientService/#disconnectuser/).

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:794](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L794)

---

### selectMessageToQuote

**selectMessageToQuote**(`message`): `void`

Selects or deselects the current message to quote reply to

#### Parameters

| Name      | Type                                                | Description                                                                 |
| :-------- | :-------------------------------------------------- | :-------------------------------------------------------------------------- |
| `message` | `undefined` \| `MessageResponse` \| `StreamMessage` | The message to select, if called with `undefined`, it deselects the message |

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1157](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1157)

---

### sendAction

**sendAction**(`messageId`, `formData`, `parentMessageId?`): `Promise<void>`

[Runs a message action](https://getstream.github.io/protocol/?urls.primaryName=Chat#/product%3Achat/RunMessageAction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).

#### Parameters

| Name               | Type                     |
| :----------------- | :----------------------- |
| `messageId`        | `string`                 |
| `formData`         | `Record<string, string>` |
| `parentMessageId?` | `string`                 |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1120](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1120)

---

### sendMessage

**sendMessage**(`text`, `attachments?`, `mentionedUsers?`, `parentId?`, `quotedMessageId?`, `customData?`, `pollId?`): `Promise<StreamMessage>`

Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.

#### Parameters

| Name              | Type                               | Default value | Description                                           |
| :---------------- | :--------------------------------- | :------------ | :---------------------------------------------------- |
| `text`            | `string`                           | `undefined`   | The text of the message                               |
| `attachments`     | `Attachment`[]                     | `[]`          | The attachments                                       |
| `mentionedUsers`  | `UserResponse`[]                   | `[]`          | Mentioned users                                       |
| `parentId`        | `undefined` \| `string`            | `undefined`   | Id of the parent message (if sending a thread reply)  |
| `quotedMessageId` | `undefined` \| `string`            | `undefined`   | Id of the message to quote (if sending a quote reply) |
| `customData`      | `undefined` \| `CustomMessageData` | `undefined`   |                                                       |
| `pollId`          | `undefined` \| `string`            | `undefined`   | Id of the poll (if sending a poll message)            |

#### Returns

`Promise<StreamMessage>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:852](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L852)

---

### setAsActiveChannel

**setAsActiveChannel**(`channel`): `void`

Sets the given `channel` as active and marks it as read.
If the channel wasn't previously part of the channel, it will be added to the beginning of the list.

#### Parameters

| Name      | Type      |
| :-------- | :-------- |
| `channel` | `Channel` |

#### Returns

`void`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:571](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L571)

---

### setAsActiveParentMessage

**setAsActiveParentMessage**(`message`, `loadMessagesForm?`): `Promise<void>`

Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.

#### Parameters

| Name               | Type                           | Default value |
| :----------------- | :----------------------------- | :------------ |
| `message`          | `undefined` \| `StreamMessage` | `undefined`   |
| `loadMessagesForm` | `"state"` \| `"request"`       | `'request'`   |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:637](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L637)

---

### typingStarted

**typingStarted**(`parentId?`): `Promise<void>`

Call this method if user started typing in the active channel

#### Parameters

| Name        | Type     | Description                                                 |
| :---------- | :------- | :---------------------------------------------------------- |
| `parentId?` | `string` | The id of the parent message, if user is typing in a thread |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1639](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1639)

---

### typingStopped

**typingStopped**(`parentId?`): `Promise<void>`

Call this method if user stopped typing in the active channel

#### Parameters

| Name        | Type     | Description                                                   |
| :---------- | :------- | :------------------------------------------------------------ |
| `parentId?` | `string` | The id of the parent message, if user were typing in a thread |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1648](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1648)

---

### unpinMessage

**unpinMessage**(`message`): `Promise<void>`

Removes the given message from pinned messages

#### Parameters

| Name      | Type            |
| :-------- | :-------------- |
| `message` | `StreamMessage` |

#### Returns

`Promise<void>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:1364](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L1364)

---

### updateMessage

**updateMessage**(`message`): `Promise<StreamMessage>`

Updates the message in the active channel

#### Parameters

| Name      | Type            | Description          |
| :-------- | :-------------- | :------------------- |
| `message` | `StreamMessage` | Mesage to be updated |

#### Returns

`Promise<StreamMessage>`

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:911](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L911)

---

### uploadAttachments

**uploadAttachments**(`uploads`): `Promise<AttachmentUpload[]>`

Uploads files to the channel. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation.

#### Parameters

| Name      | Type                 | Description                                                                                                         |
| :-------- | :------------------- | :------------------------------------------------------------------------------------------------------------------ |
| `uploads` | `AttachmentUpload`[] | the attachments to upload (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/)) |

#### Returns

`Promise<AttachmentUpload[]>`

the result of file upload requests

#### Defined in

[projects/stream-chat-angular/src/lib/channel.service.ts:995](https://github.com/GetStream/stream-chat-angular/blob/b8e03ec6da285f5e7c533ce710ebb946cded1190/projects/stream-chat-angular/src/lib/channel.service.ts#L995)


---

This page was last updated at 2026-05-13T13:38:39.037Z.

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