0

I just added below code in angularjs controller to test number value,

$scope.isNumeric = angular.isNumeric;

And I am getting this error

TypeError: angular.isNumeric is not a function

I am trying to check number type like this.

<div ng-if="isNumeric(10)">
   This is numeric
</div>

Jsfiddle : https://jsfiddle.net/49k9cLz1/2/

4
  • Can you show full code? Commented May 6, 2016 at 7:22
  • 3
    $scope.isNumeric = angular.isNumber;, There is no isNumeric method Commented May 6, 2016 at 7:23
  • If you actually meant isNumber and that has the same issue what version of angular are you using? Commented May 6, 2016 at 7:28
  • are you sure that your function is getting called? Commented May 6, 2016 at 8:51

1 Answer 1

2

You have made a mistake:

$scope.isNumeric = angular.isNumber;

Reference: isNumber

Sign up to request clarification or add additional context in comments.

1 Comment

@access404 - sorry but what does this Fiddle explain?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.