AngularJS: How do I manually set input to $valid in controller?
By : 김영민
Date : March 29 2020, 07:55 AM
|
angularjs - ng-dirty class on input type number / $valid is true when entering text
By : vinesh maurya
Date : March 29 2020, 07:55 AM
help you fix your problem It's browser "bug"(it's actually expected behaviour) see https://github.com/angular/angular.js/issues/2144 there are some workarounds, such as this https://groups.google.com/forum/#!topic/angular/pRc5pu3bWQ0/discussionor you could write your own input directive using the same principles code :
app.directive('input', [function() {
return {
restrict: 'E',
require: '?ngModel',
link: function(scope, el, attrs, ctrl) {
if (attrs.type == 'number' && typeof el.prop('validity') !== 'undefined') {
el.on('keyup change', function() {
var validity = el.prop('validity');
ctrl.$setValidity('badInput', !validity.badInput);
});
}
}
};
}]);
|
AngularJS input watch $valid or $error
By : user3439145
Date : March 29 2020, 07:55 AM
|
AngularJS input $valid is always false with no error
By : Nontombie
Date : March 29 2020, 07:55 AM
|
AngularJS Input valid if value is in array
By : erik harlert
Date : March 29 2020, 07:55 AM
|