npm ngx-editor 6.0.0
v6.0.0

latest releases: 18.0.0, 17.5.4, 17.5.3...
4 years ago

Refactor internals (a5763a3)

Migration

Menu

Before

import { NgxEditorModule } from 'ngx-editor';

NgxEditorModule.forRoot({
  menu: {
    toolbar: [],
    colorPresets: [],
  },
});

After

Menu is a seperate component, has to be included manually if required.

Component

export class AppComponent implements OnInit, OnDestroy {
  isProdMode = environment.production;

  editor: Editor;
  toolbar: Toolbar = [['bold', 'italic']];
  colorPresets = ['red', 'blue', 'green'];

  ngOnInit(): void {
    this.editor = new Editor();
  }

  ngOnDestroy(): void {
    this.editor.destroy();
  }
}

HTML

<ngx-editor-menu
  [editor]="editor"
  [toolbar]="toolbar"
  [colorPresets]="colorPresets"
>
</ngx-editor-menu>

CustomMenu

Before

<ngx-editor [customMenuRef]="customMenu"> </ngx-editor>

After

<ngx-editor-menu [customMenuRef]="customMenu"> </ngx-editor-menu>

Prosemirror Configuration

Before

import { NgxEditorModule } from 'ngx-editor';

NgxEditorModule.forRoot({
  plugins: [],
  schema: {},
  nodeViews: {},
});

After

import { Editor } from 'ngx-editor';

new Editor({
  plugins: [],
  schema: {},
  nodeViews: {},
});

Don't miss a new ngx-editor release

NewReleases is sending notifications on new releases.