Angular2 TynyMCE Text editor

0

Someone can tell if there is any property that at the time of clicking the text editor I can issue some event.

With (ngModelChange) I can type and do some action, so I need to be able to issue the action at the moment of clicking.

    
asked by anonymous 11.07.2018 / 15:09

3 answers

1

In the configuration of Tinymce module for angular you can force the click of the editor to click on the container and through the API you can define the click of the container as below:

<app-tinymce [(ngModel)]="potato" (click)="doSomethingWithPotato()"></app-tinymce>

And in your module you can instantiate Tinymce with the following config to force the click on the container:

TinymceModule.withConfig({
  setup: function(editor) {
    editor.on('click', function(e) {
      editor.editorContainer.click();
    });
  }})
    
11.07.2018 / 20:34
0

You can use the standard blur or focus html event

 <input (blur)="onBlur()" (focus)="onFocus()">
    
11.07.2018 / 15:21
0

You can associate events to your component using (onSelectionChange)="handleEvent($eventObj)" , for example.

It is strongly recommended that you read the TinyMCE documentation

    
11.07.2018 / 15:41