angular-ui / ui-tinymce

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

Validation for `ngMaxlength` and `ngMinlength` is not working on TinyMCE input with SCE enabled #227

Closed naXa777 closed 8 years ago

naXa777 commented 8 years ago
<textarea ng-model="myMCEContent" ui-tinymce ng-maxlength="180" name="body"></textarea>

I have created this <textarea> but ngMaxlength and ngMinlength are not working. For example when I typed just a single character the textarea became invalid. Then I've found that the directives work if I disable Strict Contextual Escaping. However, this is strongly discouraged. Example in jsFiddle: https://jsfiddle.net/naXa/zsnLupvd/ (try to enter some text in textarea to see an error message, then enable $sceProvider, rerun, clear all text, and try typing again)

I use TinyMCE and AngularUI wrapper for TinyMCE.

Why are ngMaxlength and ngMinlength not working in this case? And how to fix it?

deeg commented 8 years ago

Closing this as a duplicate of #145.

If you have any solutions please feel free to put out a PR. I will continue looking into it.