Different behavior for required and ng-required for initial values #9063
Description
I'm noticing different behavior when using required
vs ng-required
when combined with ng-change
. When the initial model value is any empty value besides undefined
(i.e. null
or ""
), ng-changed
is fired when using ng-required="true"
, but not when using the basic required
.
It also seems that this behavior has changed from 1.3.0 rc0 and rc1. In rc0, the change handler is never called.
The behavior for ng-required
in rc1 makes sense to me; validation is run for the initial value, null
and ""
do not pass validation so the model value is set to undefined
, and sense undefined
does not equal the initial value ng-change
is evaluated. But shouldn't the two variants behave the same?
Here is a plunker demonstrating the differences: http://plnkr.co/edit/e1J1VnUSpR8xVhdKIXVY?p=preview
I'm not sure, but this might be related to #8949 and/or #9001