(ctrl)
| 26877 | } |
| 26878 | |
| 26879 | function numberFormatterParser(ctrl) { |
| 26880 | ctrl.$parsers.push(function(value) { |
| 26881 | if (ctrl.$isEmpty(value)) return null; |
| 26882 | if (NUMBER_REGEXP.test(value)) return parseFloat(value); |
| 26883 | |
| 26884 | ctrl.$$parserName = 'number'; |
| 26885 | return undefined; |
| 26886 | }); |
| 26887 | |
| 26888 | ctrl.$formatters.push(function(value) { |
| 26889 | if (!ctrl.$isEmpty(value)) { |
| 26890 | if (!isNumber(value)) { |
| 26891 | throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); |
| 26892 | } |
| 26893 | value = value.toString(); |
| 26894 | } |
| 26895 | return value; |
| 26896 | }); |
| 26897 | } |
| 26898 | |
| 26899 | function parseNumberAttrVal(val) { |
| 26900 | if (isDefined(val) && !isNumber(val)) { |
no test coverage detected