angular-ui/angular-ui — pull request #472 by ovax3 (2013-03-03 15:19:30+00:00)
Title: Fix broken ui-validate-watch for retroactive dependencies

In the `ui-angular-watch` implementation we should not re-validate against the `$modelValue` but the `$viewValue` of the field since :

1. this is what angular naturally does ;
2. most of the time the `$modelValue` is `undefined` since angular values it if and only if the `$viewValue` is valid first.

The problem can be reproduced on the demo page by filling the `passwordConfirmation` first, and then the `password`. The `passwordConfirmation` stays invalid which is not expected.

The attached pull request fixes the problem by triggering again the natural angular validation process by simulating a change in the `$viewValue`

ctrl.$setViewValue(ctrl.$viewValue);

For instance, with this fix, the following cyclic five fields dependency schema works like a charm

A -> B -> C -> D -> E -> A