Issue
I wrote and added custom validator for input data in order to prevent form being submitted (with invalid data). And it seems as a bonus I also got no processing of invalid data -- for example ng-change is not triggered despite the input is changing.
So how to allow processing of the input, and tell Angular to use validators for telling is the form is valid or not only?
Here it is a simple plunker: https://plnkr.co/edit/AXNmvPUBGVNkwZazqUqW?p=preview When the validator returns always true, ng-change is triggered (see the console). Once you start real validation (in this case, non-empty input is invalid) you won't see ng-change fired.
Solution
It's the default behavior, but you can use ng-model-options directive to make it work as you expect, as follows:
ng-model-options="{ allowInvalid: true }"
Look at the forked DEMO.
Answered By - developer033
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.