Empty values on datepicker and ng-required attribute
Please take a look and this code: http://plnkr.co/edit/FBw7VDFlJR9TcqmGW1My
- Check validity status and error for second field:
$scope.testForm.dateFieldRequired.$valid;$scope.testForm.dateFieldRequired.$error = {"date": true, "parse": true} - Select any date in each of fields using datepicker.
- Fields are valid and there are no errors
$scope.testForm.dateField.$valid = true$scope.testForm.dateFieldRequired.$valid = true - Now, remove each value on field using mouse and/or keyboard.
- Check validity status and error for both fields:
$scope.testForm.dateField.$valid = false;$scope.testForm.dateField.$error = {"parse": true};$scope.testForm.dateFieldRequired.$valid = false;$scope.testForm.dateFieldRequired.$error = {"parse": true};
Why exactly the first field is marked as invalid when value is not provided? IMHO since this field don't contains ng-required attribute it shouldn't be validated when it is empty.
More important why there is parse error for each of those fields?
Am I missing something here?
Fixed in cfe9e3e98b95b79335751f3904b2a24233455852 and ef270789a837f7891627ea444ec5415c7d9420da. Please see commit notes for details of resolution.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.