How to start chat on button click in angular?

Hello,

I already integrate your angular UI kit in my project, and now I want to start a chat when the user clicks a button which is placed in the user profile page, when the button is clicked I will redirect to chat page but I don’t find a way to start a conversation.

Thanks

Hello @Ivelin,

You can open a one-to-one chat screen by doing the following, where selectedUser is the user object whose chat screen you want to open.

<message-list selectedUser={{stringify(selectedUser)}}></message-list>

And, you can open a group chat screen by doing the following, where selectedGroup is the group object whose chat screen you want to open.

<group-conversation-details selectedGroup={{stringify(selectedGroup)}}></group-conversation-details>

You can go through our Angular UI Kit Documentation here: https://prodocs.cometchat.com/docs/js-angular-ui-kit

1 Like