
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
ngx-editor
Advanced tools
Rich Text Editor for angular using ProseMirror
demo | edit on stackblitz | documentation | migrating from v4 | migrating from other editors
Install via Package managers such as npm or yarn
npm install ngx-editor --save
# or
yarn add ngx-editor
Note: By default the editor comes with minimal features. Refer the demo and documentation for more details and examples.
Import ngx-editor
module
import { NgxEditorModule } from 'ngx-editor';
@NgModule({
imports: [NgxEditorModule],
})
export class AppModule {}
Component
import { Editor } from 'ngx-editor';
export class EditorComponent implements OnInit, OnDestroy {
editor: Editor;
html: '';
ngOnInit(): void {
this.editor = new Editor();
}
// make sure to destory the editor
ngOnDestroy(): void {
this.editor.destroy();
}
}
Then in HTML
<div class="NgxEditor__Wrapper">
<ngx-editor-menu [editor]="editor"> </ngx-editor-menu>
<ngx-editor
[editor]="editor"
[ngModel]="html"
[disabled]="false"
[placeholder]="'Type here...'"
></ngx-editor>
</div>
Note: Input can be a HTML string or a jsonDoc
If the Input to the component is HTML, output will be HTML. To manually convert json output from the editor to html
import { toHTML } from 'ngx-editor';
const html = toHTML(jsonDoc, schema); // schema is optional
Or to convert HTML to json. Optional, as Editor will accept HTML input
import { toDoc } from 'ngx-editor';
const jsonDoc = toDoc(html);
this.editor.commands
.textColor('red')
.insertText('Hello world!')
.focus()
.scrollIntoView()
.exec();
Run exec
to apply the changes to the editor.
You can specify locals to be used in the editor
NgxEditorModule.forRoot({
locals: {
bold: 'Bold',
italic: 'Italic',
code: 'Code',
underline: 'Underline',
// ...
},
});
Mostly works on all Evergreen-Browsers like
Angular 13+.
See https://sibiraj-s.github.io/ngx-editor/#/collab
Icons are from https://material.io/resources/icons/
All contributions are welcome. See CONTRIBUTING.md to get started.
FAQs
The Rich Text Editor for Angular, Built on ProseMirror
The npm package ngx-editor receives a total of 55,065 weekly downloads. As such, ngx-editor popularity was classified as popular.
We found that ngx-editor demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.