Why is angular.isNumber() not working as expected?

前端 未结 3 1943
暗喜
暗喜 2021-01-02 03:10

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

3条回答
  •  没有蜡笔的小新
    2021-01-02 04:02

    Use it as below,

    angular.isNumber(eval('99.55'))
    

    for other expressions also we may use eval(input).

    Note: eval() is a javascript method

    Edit: It is not recommended to use eval(), as document says Never use eval()!

    Thanks @Diogo Kollross

提交回复
热议问题