mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-07 07:36:58 +00:00
BPUR: Remove unnecessary setValidity method in ngDecimal
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user