Search code examples
angularngx-quill

How can I dispaly ngx-quill rich text editor data from database to a page for view mode


I have angular project and I have used ngx-quill rich text editor, it works perfect when add new records or edit records and it stores the result in database. now I want to display the result from rich text to a component it display like this:

<p>And this is some text<strong> this is another text</strong></p>

Solution

  • This line of code will do it for you:)

    <div [innerHTML]="yourContent"></div>
    

    for more info: https://angular.io/guide/template-syntax#!#other-bindings