angular-document-editor
v1.0.7
Published
[](https://www.npmjs.com/package/angular-doc-editor) [](https://www.npmjs.com/package/angular-doc-editor) [Using the component in your templates Use the editor in your templates like this:
<jodit-editor [config]="{buttons: 'bold'}"></jodit-editor>In config you can set all Jodit's options
Note about toolbar buttons override:
Jodit editor apply a different toolbar buttons layout based on width available for the editor itself. So a different width size for editor will show a different buttons layout. The "buttons" config setting in the example above will override only the default toolbar buttons for large widths. If you want to override buttons displayed on all editor sizes use something like this:
<jodit-editor
[config]="{
buttons: 'bold,strikethrough,underline,italic'
buttonsMD: 'bold,strikethrough,underline,italic'
buttonsSM: 'bold,strikethrough,underline,italic'
buttonsXS: 'bold,strikethrough,underline,italic'
};"
></jodit-editor> Event binding
You can also bind editor events via a shorthand prop on the editor, for example:
<jodit-editor (onChange)="handleEvent($event)"></jodit-editor>Events list
- onChange
- onKeydown
- onMousedown
- onClick
- onFocus
- onPaste
- onResize
- onBeforeEnter
- onBeforeCommand
- onAfterCommand
- onAfterExec
- onAfterPaste
- onChangeSelection
Where the handler gets called with an object containing the properties event, which is the event object, and editor, which is a reference to the editor.
Versions
- Angular 14 use v1.0.*
- Angular 15 use v1.0.*
License
This package is available under MIT License.
