angular-ui / ui-tinymce

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

On focus lost, ng-model not being updated #313

Open mjmarianetti opened 7 years ago

mjmarianetti commented 7 years ago

When you have text in the editor, and you erase it selecting it and pressing backspace. The directive does not update the ng-model.

Quickfix (I am using typescript, the example might not work but you get the idea):

$scope.model; $scope.ngModelCtrl;

$scope.tinymceOptions = {
setup = (editor) => {
                editor.on('keyup',(e) =>{
                   $scope.ngModelCtrl.$setViewValue($scope.model);
                   $scope.ngModelCtrl.$setTouched();
                  $scope.ngModelCtrl.$setDirty();
                });
            }
}
deeg commented 7 years ago

Please post a plunker showing your issue or post a PR fixing your problem.