Search code examples
angular7quill

how to display quilljs editor written data in Angular coming from Node API


I have data written in QuillJS Editor, when I store that data it stores the data along with the HTML tags in my database.

For Example if I right this in the editor

 This is an example.

It is stored as

 <p>This is an example.</p>

Now when I'm trying to display these data in my Angular front-end HTML file it shows the HTML tags along with the data enclosed between them.

 <p>This is an example.</p>

How will I only show the text enclosed in the tags and not the HTML tags?


Solution

  • To Display data in HTML that was entered by a user using QuillJs, you have to use QuillJs editor in read mode to display that data.

    <quill-editor [(ngModel)]="yourNgModel" [readOnly]="isReadOnly" [modules]="{toolbar: false}">
              </quill-editor>