angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

ng-model is not getting updated properly #262

Closed rguruprakash closed 8 years ago

rguruprakash commented 8 years ago

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

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

rguruprakash commented 8 years ago

Found a workaround using editor.execCommand('mceInsertContent', false, a);

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