(ctrl)
| 26812 | } |
| 26813 | |
| 26814 | function numberFormatterParser(ctrl) { |
| 26815 | ctrl.$parsers.push(function(value) { |
| 26816 | if (ctrl.$isEmpty(value)) return null; |
| 26817 | if (NUMBER_REGEXP.test(value)) return parseFloat(value); |
| 26818 | |
| 26819 | ctrl.$$parserName = 'number'; |
| 26820 | return undefined; |
| 26821 | }); |
| 26822 | |
| 26823 | ctrl.$formatters.push(function(value) { |
| 26824 | if (!ctrl.$isEmpty(value)) { |
| 26825 | if (!isNumber(value)) { |
| 26826 | throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); |
| 26827 | } |
| 26828 | value = value.toString(); |
| 26829 | } |
| 26830 | return value; |
| 26831 | }); |
| 26832 | } |
| 26833 | |
| 26834 | function parseNumberAttrVal(val) { |
| 26835 | if (isDefined(val) && !isNumber(val)) { |
no test coverage detected