You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
I'm developer of Angular.js Input Modified directive. Our module is used to detect changes in the form fields. We heavily depend on the ngModel interface in our implementation and I wanted to say that you've made a great job of implementing it properly.
However, there's an issue with model value idempotency. Sometimes, when you take current value from the directive and then feed it back to it, you will get yet another value. It looks like TinyMCE is refactoring the HTML code when you feed it to it (reordering attributes for example). Maybe it's not a strict violation of the ngModel interface, but it breaks our model change detection mechanism (because returned value is not always equal to provided one).
For now, I have had to add a stabilization function to our module in order to overcome this problem. I suggest you to implement it in your code as well (for better compatibility).
/** * Stabilizes model's value. * This is required for directives such as Angular UI TinyMCE. */functionstabilizeValue(callback){varinitialValue=modelCtrl.$modelValue;modelCtrl.$modelValue=null;$timeout(function(){modelCtrl.$modelValue=initialValue;$timeout(callback,0);},0);}
The text was updated successfully, but these errors were encountered:
Possibly a related issue: I have a ui-tinymce in a form and it is bound like so:
ng-model="some.object.property"
Initially, the object $scope.some does exist, but $scope.some.object does not exist and is only created once a model value, like $scope.some.object.property is set.
It appears as though as soon as the ui-tinymce field is loaded, it will automatically set its model value to <p><br data-mce-bogus="1"></p> without any user interaction.
For my use case, I am relying on $scope.some.object not existing until the user does something to create it, and thus this behavior breaks my form's functionality.
@timscaffidi I believe your issue with ng-model="some.object.property" is unrelated. I had your issue, Tim, and fixed it by applying priority: 999, to the ui-tinymce directive. There is an open PR for this same fix.
I inserted a console log into ngModel.$formatters and noticed that, when my network call completed, some.object.property was executing the formatter, but then ngModel.$render was never called. Quick bit of googling suggested it was a directive priority issue. So I added priority: 999,.
Hello!
I'm developer of Angular.js Input Modified directive. Our module is used to detect changes in the form fields. We heavily depend on the
ngModel
interface in our implementation and I wanted to say that you've made a great job of implementing it properly.However, there's an issue with model value idempotency. Sometimes, when you take current value from the directive and then feed it back to it, you will get yet another value. It looks like TinyMCE is refactoring the HTML code when you feed it to it (reordering attributes for example). Maybe it's not a strict violation of the ngModel interface, but it breaks our model change detection mechanism (because returned value is not always equal to provided one).
For now, I have had to add a stabilization function to our module in order to overcome this problem. I suggest you to implement it in your code as well (for better compatibility).
The text was updated successfully, but these errors were encountered: