Ngx-quill: How to render HTML generated by Quill in Angular 6

Created on 11 Oct 2018  ·  2Comments  ·  Source: KillerCodeMonkey/ngx-quill

I am simply creating content using quill editor and saving it to my firebase database. Quill adds its own classes to generated content to align them center, left, right etc.

Now, I am retrieving that content from database and using innerHTML property of an element to set it inside a container. The problem is that quill alignment classes are not working at all. I can see the classes assigned to the elements but they are not working.

I assume I am rendering it in a wrong way, can you please provide some guidance how to render that content so that all the quill classes should work as expected.

Most helpful comment

Thanks, got the solution. Anybody who is looking for solution, I used the code given below.

<quill-editor [(ngModel)]="productDetail" [readOnly]="true" [modules]="{toolbar:false}" [style]="{border: '0px'}"></quill-editor>

All 2 comments

You should Use quill to render it. An editor without a toolbar and readonly
Mode.

Or rebuild the quill-editor html structure and add the quill css Files

petermarks12 notifications@github.com schrieb am Do., 11. Okt. 2018,
16:31:

I am simply creating content using quill editor and saving it to my
firebase database. Quill adds its own classes to generated content to align
them center, left, right etc.

Now, I am retrieving that content from database and using innerHTML
property of an element to set it inside a container. The problem is that
quill alignment classes are not working at all. I can see the classes
assigned to the elements but they are not working.

I assume I am rendering it in a wrong way, can you please provide some
guidance how to render that content so that all the quill classes should
work as expected.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/KillerCodeMonkey/ngx-quill/issues/256, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ACKOYOhu7U7yqznNZYgywNnytAbXrl_Vks5uj1YwgaJpZM4XXpBw
.

Thanks, got the solution. Anybody who is looking for solution, I used the code given below.

<quill-editor [(ngModel)]="productDetail" [readOnly]="true" [modules]="{toolbar:false}" [style]="{border: '0px'}"></quill-editor>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rlcolli4 picture Rlcolli4  ·  3Comments

pedrojrivera picture pedrojrivera  ·  4Comments

qikong333 picture qikong333  ·  5Comments

Fzwael picture Fzwael  ·  3Comments

KeithGillette picture KeithGillette  ·  4Comments