You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The chosen module decides what kind of `textarea` should be used in the message composer, you can choose between the [`AutocompleteTextareaComponent`](../components/AutocompleteTextareaComponent.mdx) with mentions or the [`TextareaComponent`](../components/TextareaComponent.mdx) that doesn't support mentions, but has a smaller bundle size. Your final application bundle will only include either the `TextareaComponent` or the `AutocompleteTextareaComponent`.
You should import the `TranslateModule.forRoot()` in a non-lazy loaded module (for example `AppModule`) even if the chat application is displayed from a lazy loaded module. If the translation isn't initialized properly the UI labels will be displayed as `"streamChat..."`.
29
40
:::
30
41
42
+
If you're using standalone components, make sure to also import the `TranslateModule` to the component that displays the chat UI:
Initialize the translation in the **constructor** of the component which displays the chat UI (for example `AppComponent`)
@@ -48,14 +83,7 @@ It's important to call the `setTranslation` in the constructor of the component
48
83
49
84
### Module import
50
85
51
-
If you are already using ngx-translate in your project, we suppose you already have it installed and the `TranslateModule` is configured and imported. You just have to import the `StreamChatModule`:
If you are already using ngx-translate in your project, you already have the `TranslateModule` imported and configured in your project, so you **don't** need to import `TranslateModule.forRoot()`. However you still need to import `TranslateModule` (**without** the `forRoot`) to the module/standalone component that displays the chat UI to access the `translate` pipe.
Copy file name to clipboardExpand all lines: projects/stream-chat-angular/src/lib/chat-client.service.ts
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@ export class ChatClientService<
89
89
* @param userOrId you can emit this for anonymous logins
90
90
* @param userTokenOrProvider You can provide:<ul>
91
91
* <li> a token, </li>
92
+
* <li> a token provider, a method that returns `Promise<string>`, which can be called when the previous token expires (recommended setup for production applications)</li>
92
93
* <li> the keyword 'guest' to connect as [guest user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#guest-users) </li>
93
94
* <li> the keyword 'anonymous' to connect as [anonymous user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#anonymous-users) </li>
0 commit comments