angular-ui / ui-tinymce

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

Updating ng-model on click stops updating the editor contents after a few changes #263

Open DfKimera opened 8 years ago

DfKimera commented 8 years ago

I have a screen that allows the user to edit several HTML sections in the same page. So there's a $scope variable called contents, that has a bunch of objects with HTMLs in them, and a single editor, with the ng-model pointing to $scope.content. When the user selects a file, the ng-click event points $scope.content to the appropriate item in $scope.contents.

When the user writes a bunch of text in the editor, then clicks another item, the model is appropriately updated and the editor is reloaded with the contents of the other item. When this is repeated 3 or 4 times, the editor stops updating its content, and stops updating the model. A few more clicks here and there and both are updated, but some of the things the user typed on the editor are not saved.

Example: https://plnkr.co/edit/ufSY8KoYJTjBCeBTSpTw?p=preview

How to reproduce: