ng-pattern-restrict icon indicating copy to clipboard operation
ng-pattern-restrict copied to clipboard

$dirty is true, even if there is not text inside

Open sebaplaza opened this issue 10 years ago • 2 comments

I know that there is part of the angular validation behaviour, but would be great to manage this:

When you use use ng-pattern-restrict with, for example: "^\d*$"

If you write letters, the restrict works fine, but the input gets $dirty=true , even if the input is empty.

sebaplaza avatar Mar 20 '15 10:03 sebaplaza

Thanks for the report -- I definitely agree with you.

AlphaGit avatar Mar 21 '15 18:03 AlphaGit

@AlphaGit @sebaplaza having this problem too. Is it possible such that we track and save pristine state of ngModelController before change? Then if test fail or value remain the same (when no value change, but event is triggered anyway) just revert the ngModelController back to previous state after $setViewValue

poonwu avatar Aug 25 '16 15:08 poonwu