Gathering detailed insights and metrics for ngx-quill-v2
Gathering detailed insights and metrics for ngx-quill-v2
Gathering detailed insights and metrics for ngx-quill-v2
Gathering detailed insights and metrics for ngx-quill-v2
ngx-quill
Angular components for the easy use of the QuillJS richt text editor.
react-quill
The Quill rich-text editor as a React component.
ngx-quill-upload-ivy
A module for images and videos to be uploaded to a server instead of being base64 encoded, in ngx-quill from toolbar editor.
quill
Your powerful, rich text editor
npm install ngx-quill-v2
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
435 Commits
2 Forks
4 Branches
1 Contributors
Updated on 10 Oct 2021
TypeScript (95.07%)
JavaScript (4.93%)
Cumulative downloads
Total Downloads
Last day
-7.2%
451
Compared to previous day
Last week
-50.5%
2,706
Compared to previous week
Last month
3,522.3%
41,910
Compared to previous month
Last year
2,924.6%
43,584
Compared to previous year
1
5
40
ngx-quill-v2 is an angular (>=2) component for the Quill Rich Text Editor v2 dev version.
I have kept the link of all the existing examples from ngx-quill. In addition to the examples I have added a new example using table support.
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-v2
npm 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
]
};
snow
true
, 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
, bottom
warn
, error
, log
or false
to deactivate logging, default: warn
user
(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.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
101 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More