BPUR: Remove unnecessary setValidity method in ngDecimal

This commit is contained in:
Rob H
2013-06-20 22:47:19 +05:30
committed by Rohan Mitchell
parent 4ae5085192
commit f9832d1375

View File

@@ -14,16 +14,7 @@ productsApp.directive('ngDecimal', function () {
scope.$apply(ngModel.$setViewValue(ngModel.$modelValue));
ngModel.$render();
});
ngModel.$setValidity('notADecimalError', function(){
if (angular.isString(ngModel.$modelValue) && numRegExp.test(ngModel.$modelValue)){
return true;
}
else{
return false;
}
});
ngModel.$parsers.push(function(viewValue){
if (angular.isString(viewValue) && numRegExp.test(viewValue)){
if (viewValue.indexOf(".") == -1){