ng-model is not getting updated properly (angular-ui-tinymce)

443 Views Asked by At

I am trying to insert a DOM node on a custom button click. but the model associated with the textarea is not getting updated.

I have created a plunker to demonstrate the issue.

[https://plnkr.co/edit/Qe3COw][1]

Try clicking the 'My Button' more than once. from the second click, the model is not getting updated.

Thanks in advance, i hope the question is understandable

1

There are 1 best solutions below

0
On

Using the below function solved the issue for me.

editor.execCommand('mceInsertContent', false, a);

Plunker:

https://plnkr.co/edit/vHF3sS?p=preview