
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
ngx-quill-advance
Advanced tools
An angular (>= v2) component for the easy use of the QuillJS rich text editor for v2
ngx-quill is an angular (>=2) component for the Quill Rich Text Editor v2 dev version.
If you like my work, feel free to support it. Donations to the project are always welcomed :)
PayPal: PayPal.Me/arghya2609
| Angular | ngx-quill | supported/maintained |
|---|---|---|
| v7 | >= 4.0.0 | until Apr 18, 2020 |
| v6 | >= 3.0.0 | until Nov 3, 2019 |
| v5 | > 1.6.0 | until May 1, 2019 |
| v4 | < 1.6.0 | no |
npm install ngx-quill-v2npm install ngx-quill@1.6.0@angular/core, @angular/common, @angular/forms, quill and rxjs - peer dependencies of ngx-quill@import statements, or add them external stylings in your build process.QuillModule from ngx-quill-v2:import { QuillModule } from 'ngx-quill-v2'
QuillModule to the imports of your NgModule:@NgModule({
imports: [
...,
QuillModule
],
...
})
class YourModule { ... }
<quill-editor></quill-editor> in your templates to add a default quill editorHINT: If you are using lazy loading modules, you have to add QuillModule to your imports in your root module to make sure the Config services is registered.
Ngx-quill updates the ngModel or formControl for every user change in the editor.
Checkout the QuillJS Source parameter of the text-change event.
If you are using the editor reference to directly manipulate the editor content and want to update the model, pass 'user' as the source parameter to the QuillJS api methods.
html, values: html | object | text | json, sets the model value type - html = html string, object = quill operation object, json = quill operation json, text = plain text{
toolbar: [
['bold', 'italic', 'underline', 'strike'], // toggled buttons
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }], // custom button values
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
[{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
[{ 'indent': '-1'}, { 'indent': '+1' }], // outdent/indent
[{ 'direction': 'rtl' }], // text direction
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
[{ 'font': [] }],
[{ 'align': [] }],
['clean'], // remove formatting button
['link', 'image', 'video'] // link and image, video
]
};
snowtrue, boolean (only for format="html")[styles]="{height: '250px'}"Insert text here ...document.body, pass 'self' to attach the editor elementinvalid and add ng-invalid classinvalid and add ng-invalid class, only set invalid if editor text not empty --> if you want to check if text is required --> use the required attribute[required]="true" - default: false, boolean expected (no strings!)[quill-editor-toolbar]:<quill-editor>
<div quill-editor-toolbar>
<span class="ql-formats">
<button class="ql-bold" [title]="'Bold'"></button>
</span>
<span class="ql-formats">
<select class="ql-align" [title]="'Aligment'">
<option selected></option>
<option value="center"></option>
<option value="right"></option>
<option value="justify"></option>
</select>
<select class="ql-align" [title]="'Aligment2'">
<option selected></option>
<option value="center"></option>
<option value="right"></option>
<option value="justify"></option>
</select>
</span>
</div>
</quill-editor>
top, possible values top, bottomwarn, error, log or false to deactivate logging, default: warnuser (quill source user) or all change should be trigger model update, default user. Using all is not recommended, it cause some unexpected sideeffects.It is possible to set custom default modules and Quill config options with the import of the QuillModule.
@NgModule({
imports: [
...,
QuillModule.forRoot({
modules: {
syntax: true,
toolbar: [...]
}
})
],
...
})
class YourModule { ... }
If you want to use the syntax module follow the Syntax Highlight Module Guide.
See Quill Configuration for a full list of config options.
The QuillModule exports the defaultModules if you want to extend them :).
editor // Quill
{
editor: editorInstance, // Quill
html: html, // html string
text: text, // plain text string
content: content, // Content - operatins representation
delta: delta, // Delta
oldDelta: oldDelta, // Delta
source: source // ('user', 'api', 'silent' , undefined)
}
{
editor: editorInstance, // Quill
range: range, // Range
oldRange: oldRange, // Range
source: source // ('user', 'api', 'silent' , undefined)
}
{
editor: editorInstance, // Quill
source: source // ('user', 'api', 'silent' , undefined)
}
{
editor: editorInstance, // Quill
source: source // ('user', 'api', 'silent' , undefined)
}
In most cases a wysiwyg editor is used in backoffice to store the content to the database. On the other side this value should be used, to show the content to the enduser.
In most cases the html format is used, but it is not recommended by QuillJS, because it has the intention to be a solid, easy to maintain editor. Because of that it uses blots and object representations of the content and operation.
This content object is easy to store and to maintain, because there is no html syntax parsing necessary. So you even switching to another editor is very easy when you can work with that.
In general QuillJS recommends to use a QuillJS instance to present your content. Just create a quill editor without a toolbar and in readonly mode. With some simple css lines you can remove the default border around the content.
Most of you will use the html format (even it is not recommended). To render custom html with angular you should use the [innerHTML] attribute.
But there are some pitfalls:
After that your content should look like what you expected.
If you store html in your database, checkour your backend code, sometimes backends are stripping unwanted tags as well ;).
Angular templates provide some assurance against XSS in the form of client side sanitizing of all inputs https://angular.io/guide/security#xss.
Ngx-quill provides the config paramter sanitize to sanitize html-strings passed as ngModel or formControl to the component.
It is deactivated per default to avoid stripping content or styling, which is not expected.
But it is recommended to activate this option, if you are working with html strings as model values.
FAQs
An angular (>= v2) component for the easy use of the QuillJS rich text editor for v2
The npm package ngx-quill-advance receives a total of 6 weekly downloads. As such, ngx-quill-advance popularity was classified as not popular.
We found that ngx-quill-advance demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.