angular-strap
angular-strap copied to clipboard
Manually typing in timepicker field throws digest errors
Hi,
please see this plunker: http://plnkr.co/edit/AlPGUYXgUu8ysHEE5kft?p=preview
Basically, when the model is null and you try to type in the time, every keystroke generates 2 errors in the dev. console (chrome)
Honza
Seems like return is missing in the parsers:
controller.$parsers.unshift(function(viewValue) {
// console.warn('$parser("%s"): viewValue=%o', element.attr('ng-model'), viewValue);
// Null values should correctly reset the model value & validity
if(!viewValue) {
controller.$setValidity('date', true);
return;
}
var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);
if(!parsedTime || isNaN(parsedTime.getTime())) {
controller.$setValidity('date', false);
=====> return;
} else {
This way it is handled in datepicker. Putting return in the marked place fixes the issue.
Jan
It relates to #623
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.