(ctrl)
| 26005 | } |
| 26006 | |
| 26007 | function numberFormatterParser(ctrl) { |
| 26008 | ctrl.$parsers.push(function(value) { |
| 26009 | if (ctrl.$isEmpty(value)) return null; |
| 26010 | if (NUMBER_REGEXP.test(value)) return parseFloat(value); |
| 26011 | |
| 26012 | ctrl.$$parserName = 'number'; |
| 26013 | return undefined; |
| 26014 | }); |
| 26015 | |
| 26016 | ctrl.$formatters.push(function(value) { |
| 26017 | if (!ctrl.$isEmpty(value)) { |
| 26018 | if (!isNumber(value)) { |
| 26019 | throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); |
| 26020 | } |
| 26021 | value = value.toString(); |
| 26022 | } |
| 26023 | return value; |
| 26024 | }); |
| 26025 | } |
| 26026 | |
| 26027 | function parseNumberAttrVal(val) { |
| 26028 | if (isDefined(val) && !isNumber(val)) { |
no test coverage detected