Is there a simple way to make inputs and textareas with the ng-required attribute set to true invalid if it contains only spaces or blank characters ?
I'm looking for a generic way that would be applied to all my fields.
Note : I'm using angular 1.5.5
Ok, so in the end I didn't manage to find a generic way. I had to change every template, but it can be done quickly using the replace option of any IDE.
I replaced every
<textareaoccurences with<textarea ng-pattern="/^(?=.*\S).+$/"So,
ng-patternwas my solution choice, there's probably a better way though.