froala / angular-froala

Angular.js bindings for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
MIT License
306 stars 123 forks source link

Can't set ng-model parameter to NULL normally #150

Closed liu87 closed 5 years ago

liu87 commented 7 years ago

Environment: AngularJS 1.5.8, froala-editor 2.6.4, angular-froala latest version

1、try to set parameter to NULL by a button click, it's worked; 2、bind the step1's parameter to froala as ng-model; // {"contents":"<h1>Hello World</h1>"} 3、click button once, parameter changed but remain something; // {"contents":""} 4、click button again, parameter finally comes to NULL; // NULL

Code ---------------------HTML-------------------- <textarea ng-model="richtext.contents" froala></textarea> <!-- can observe it carefully --> {{richtext}} <button ng-click="clear()">Clear</button>

---------------------JS------------------------ $scope.richtext = {}; $scope.richtext.contents = "<h1>Hello World</h1>"; $scope.clear = function() { $scope.richtext = null; }

PS: other froala functions are test and passed, it seems not a config problem; The problem seems occured in complicate parameter, like $scope.richtext.contents. simple parameter as $scope.richtext is OK.

stefanneculai commented 6 years ago

@liu87 do you think you could make a Plunker so that we can easily look into it?

stefanneculai commented 5 years ago

Closing this due to lack of response.