It appears as if AngularJS\'s angular.isNumber is not working. It doesn\'t work with strings that are numbers. Am I doing something wrong? Should I just use
angular.isNumber
I was working on the same problem and I was trying to work around that edge case. So I created a slightly different approach.
FIDDLE
function isStringNumber(str) { var parsed = parseFloat(str); var casted = +str; return parsed === casted && !isNaN(parsed) && !isNaN(casted); }