Skip to content
Related Articles

Related Articles

AngularJS | angular.isNumber() Function

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 12 Apr, 2019

The angular.isNumber() function in AngularJS is used to determine the parameter inside isNumber function is a number or not. It returns true if the reference is a number otherwise returns false.


angular.isNumber( value )

Return Value: It returns true if the passed value is a number else false.

Example: This example uses angular.isNumber() function to determine the given input is number or not.

<!DOCTYPE html>
        <script src=
    <body ng-app="app" style="text-align:center">
        <h1 style="color:green">GeeksforGeeks</h1>
        <div ng-controller="geek">
            <b>Input1: </b
            <b>IsNumber: </b>{{isNumber1}}<br /><br><br>
            <b>Input2: </b
            <b>IsNumber:</b> {{isNumber2}}
        <!-- Script to uses angular.isNumber() Function -->
            var app = angular.module("app", []);
            app.controller('geek', ['$scope', function ($scope) {
                var obj1 = 123;
                var obj2 = "geeksforgeeks";
                $scope.isNumber1 = angular.isNumber(obj1);
                $scope.isNumber2 = angular.isNumber(obj2);


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!