Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-document-editor

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-document-editor

[![npm](https://img.shields.io/npm/v/angular-doc-editor.svg)](https://www.npmjs.com/package/angular-doc-editor) [![npm](https://img.shields.io/npm/dm/angular-doc-editor.svg)](https://www.npmjs.com/package/angular-doc-editor) [![npm](https://img.shields.io

  • 1.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
99
decreased by-1.98%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Doc Editor Component

npm npm npm

This package is a wrapper around Jodit to make it easier to use in a Angular application.

for contributors

The editor component itselt is located in the angular-doc-editor folder and packaged into a redistributable package with the ng-packagr tool. A test app has been created with the @angular/cli. It is located in the src directory and a dev server can be started by using the npm start command.

Installation

$ npm install angular-doc-editor

Usage

Loading the component

Import the EditorModule from the npm package like this:

import { AngularDocumentEditorModule } from 'angular-doc-editor';

And add it to you application module:

// This might look different depending on how you have set up your app
// but the important part is the imports array
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AngularDocumentEditorModule // <- Important part
  ],
  providers: [],
  bootstrap: [AppComponent]
})

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.

FAQs

Package last updated on 18 Oct 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc