angular6jhipsterquillngx-quill

How to render the ngx-quill-editor content without html tags on JHipster project?


I'm new to the JHipster and Angular6. I've created a project using JHipster and included ngx-quill-editor for an editor. I'm able to save the data using this editor, but when I retrieve the data from the database to display on another page to preview it shows HTML tags. I'm not sure that do I've to render when I'm saving into the database or retrieving from the database or is there any tag which I'm missing eighter saving or retrieving content to render?

<quill-editor name="message" [(ngModel)]="message" required></quill-editor>

I didn't find any tutorial for this example. Any help would be appreciated.

Thanks!


Solution

  • You should not render the message value, but show it as an innerHtml of some tag:

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

    Take a look at Angular HTML binding