Angular2 Tynymce Text editor

Asked

Viewed 139 times

0

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

With (ngModelChange) I can type and do some action, then I need that at the moment of clicking I can already send the action.

3 answers

1


In the configuration of the Tinymce module for the angular you can force the editor click a click on the container and through the API you can set the container click 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();
    });
  }})

0

You can use the default Blur or Focus html event

 <input (blur)="onBlur()" (focus)="onFocus()">
  • I’m calling the <app-tynymce> component the input text is inside the component, I need some property that accesses the internal input

  • @Gustavo inside your internal component creates a method that takes the input click and makes an Eventemitter to return to your current component.

0

It is possible to associate events to your website using (onSelectionChange)="handleEvent($eventObj)", for example.

It is strongly recommended that you read the tinymce documentation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.