MCPcopy
hub / github.com/angular-ui/ui-router / maxChange

Function maxChange

test/angular/1.7/angular.js:27072–27092  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

27070 }
27071
27072 function maxChange(val) {
27073 maxVal = parseNumberAttrVal(val);
27074 // ignore changes before model is initialized
27075 if (isNumberNaN(ctrl.$modelValue)) {
27076 return;
27077 }
27078
27079 if (supportsRange) {
27080 var elVal = element.val();
27081 // IE11 doesn't set the el val correctly if the maxVal is less than the element value
27082 if (maxVal < elVal) {
27083 element.val(maxVal);
27084 // IE11 and Chrome don't set the value to the minVal when max < min
27085 elVal = maxVal < minVal ? minVal : maxVal;
27086 }
27087 ctrl.$setViewValue(elVal);
27088 } else {
27089 // TODO(matsko): implement validateLater to reduce number of validations
27090 ctrl.$validate();
27091 }
27092 }
27093
27094 function stepChange(val) {
27095 stepVal = parseNumberAttrVal(val);

Callers

nothing calls this directly

Calls 1

parseNumberAttrValFunction · 0.70

Tested by

no test coverage detected