Open rolintoucour opened 8 years ago
The validation does not work because a <p>
element is inserted by default if there is no value of the model. I think this is done by design thus you have to control the required behavior in a custom way
For example, if you want to disable a submit button when the editor has no content yet:
<button role="submit" ng-disabled="editor.model === '<p></p>'"></button>
I added a ng-required attribute to ng-wig and noticed that, on the first focus on the ng-wig, the input was validated (even if empty).
The problem is that, on $onInit, a '
' is inserted in the model, so the required validation cannot work.A temporary workaround is to use a placeholder (
isn't inserted this way).