# MessageService

> **Info:** This is release candidate documentation for **Stream Chat Angular SDK v8**. For the latest stable version, see the [latest version (v7)](https://getstream.io/chat/docs/sdk/angular/).

The message service contains configuration options related to displaying the message content

## Properties

### customLinkRenderer

`Optional` **customLinkRenderer**: (`url`: `string`) => `string`

You can provide a custom method to display links

#### Type declaration

(`url`): `string`

##### Parameters

| Name  | Type     | Description                      |
| :---- | :------- | :------------------------------- |
| `url` | `string` | the url the link should refer to |

##### Returns

`string`

#### Defined in

[projects/stream-chat-angular/src/lib/message.service.ts:25](https://github.com/GetStream/stream-chat-angular/blob/8ed7ea67ea3deb96c2ae7fcccfd82bd32ad7f184/projects/stream-chat-angular/src/lib/message.service.ts#L25)

---

### displayAs

**displayAs**: `"html"` \| `"text"` = `'text'`

Decides if the message content should be formatted as text or HTML

If you display messages as text the following parts are still be displayed as HTML:

- user mentions -> you can customize this with your own template using the [`customTemplatesService.mentionTemplate$`](https://getstream.io/chat/docs/sdk/angular/v8/services/CustomTemplatesService/#mentiontemplate)
- links -> you can customize this by providing you own [`customLinkRenderer`](#customlinkrenderer) method

#### Defined in

[projects/stream-chat-angular/src/lib/message.service.ts:18](https://github.com/GetStream/stream-chat-angular/blob/8ed7ea67ea3deb96c2ae7fcccfd82bd32ad7f184/projects/stream-chat-angular/src/lib/message.service.ts#L18)

---

### filterCustomAttachment

`Optional` **filterCustomAttachment**: (`attachment`: `Attachment`) => `boolean`

The SDK supports the following attachment types: `image`, `file`, `giphy`, `video` and `voiceRecording` attachments.

All other types are treated as custom attachments, however it's possible to override this logic, and provide a custom filtering method which can be used to treat some built-in attachments as custom.

Provide a method which retruns `true` if an attachment should be considered as custom.

#### Type declaration

(`attachment`): `boolean`

##### Parameters

| Name         | Type         |
| :----------- | :----------- |
| `attachment` | `Attachment` |

##### Returns

`boolean`

#### Defined in

[projects/stream-chat-angular/src/lib/message.service.ts:33](https://github.com/GetStream/stream-chat-angular/blob/8ed7ea67ea3deb96c2ae7fcccfd82bd32ad7f184/projects/stream-chat-angular/src/lib/message.service.ts#L33)

## Methods

### isCustomAttachment

**isCustomAttachment**(`attachment`): `boolean`

Tells if an attachment is custom (you need to provide your own template to display them) or built-in (the SDK supports it out-of-the-box)

#### Parameters

| Name         | Type         |
| :----------- | :----------- |
| `attachment` | `Attachment` |

#### Returns

`boolean`

`true` if the attachment is custom

#### Defined in

[projects/stream-chat-angular/src/lib/message.service.ts:42](https://github.com/GetStream/stream-chat-angular/blob/8ed7ea67ea3deb96c2ae7fcccfd82bd32ad7f184/projects/stream-chat-angular/src/lib/message.service.ts#L42)

---

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