The ui-validate demo appears to be broken / incomplete
alexspurling opened this issue · 2 comments
Here are some bugs I have found in the ui-validate demo:
- Enter the value "a@b" into the email field. The input field is blue (valid) despite the 'email' validation error saying true. Expected: input field should turn red.
- Enter the value "bad@domain.com". The input field is blue and the blacklist validation error is false. Expected: input field should turn red, blacklist validation error should be true.
- Enter a value into first password field. Enter a different value into second password field. The second password field is blue (valid). Expected: the second password field should be red.
Secondly, there is no mention of the ui-validate-watch directive or what this does. Could this be included in the documentation?
@alexspurling sorry I'm running around trying to put out fires AND keep a day job.
Do you think you can help us out by opening a Pull Request? If not, maybe @joseym can look into this?
- This is a bug with AngularJS angular/angular.js#1999
- Need to look into this...
- The validation rule should only be applied to only the second field. The validation CLASS however can be applied to both, but that may be up to the developer.
ui-validate-watch allows you to re-run a validation rule whenever the expression changes. In other words, the confirm_password rule can be refreshed whenever you change the password (primary) field. Normally, validation rules are ONLY checked when you modify their related inputs.
@alexspurling again, do you mind helping us out with a PR?
@alexspurling here is a fiddle using raw angularjs validation and this issue with input state: http://jsfiddle.net/joseym/bjpNy/
Great catch on the others, I'll clean that up.