Gaara
Gaara

Reputation: 78

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

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

Upvotes: 0

Views: 439

Answers (1)

Gaara
Gaara

Reputation: 78

Using the below function solved the issue for me.

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

Plunker:

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

Upvotes: 1

Related Questions