MessageTextComponent

The MessageTextComponent displays the text content of a message.

Basic usage

<stream-message-text
  [message]="message"
  [shouldTranslate]="shouldTranslate"
  [translation]="translation"
  [isQuoted]="isQuoted"
></stream-message-text>

The component doesn't translate the message itself: the text in translation is displayed if shouldTranslate is true. If you display the component from a custom message text template, pass the translation field of the template context (MessageTextContext). Outside of templates, you can get the translation with getMessageTranslation(message, language, currentUserId), see Message.

Customization

You can provide your own message text component using the CustomTemplatesService.

Inputs and outputs

message

message: undefined | MessageResponse | LocalMessage

The message which text should be displayed

Defined in

lib/message-text/message-text.component.ts:26


isQuoted

isQuoted: boolean = false

true if the component displayes a message quote

Defined in

lib/message-text/message-text.component.ts:30


shouldTranslate

shouldTranslate: boolean = false

true if the

Defined in

lib/message-text/message-text.component.ts:34


translation

translation: undefined | string

The translation of the message text, it's displayed if shouldTranslate is true

Defined in

lib/message-text/message-text.component.ts:38