I am using the Nebular chat component and it is working fine.
But I am unable to send HTML message in that. Such as
Hello world Hello World
Can you please help to achieve this in the nebular chat?
Edit 1
This is sample code for send message :
this.messages.push({
text: "Hello world",
date: new Date(),
reply: true,
type: files.length ? 'file' : 'text',
files: files,
user: {
name: 'Jonh Doe',
avatar: 'https://i.gifer.com/no.gif',
},
});
Output: Hello world
For sending HTML message I have tried below code
this.messages.push({
text: <b>Hello World</b>,
date: new Date(),
reply: true,
type: files.length ? 'file' : 'text',
files: files,
user: {
name: 'Jonh Doe',
avatar: 'https://i.gifer.com/no.gif',
},
});
Output :<b>Hello world</b>
It is printing HTML character in the message
Edit 2:
Ok, I got the problem. Nebular wants just string for message. So there is no way to send HTML styled text. But you can find the element and replace it with styled one on ngAfterViewInit.
Old Answer
Have you tried something like this?
https://github.com/akveo/ngx-admin/blob/master/src/app/pages/editors/ckeditor/ckeditor.component.ts
Edit 1: