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.
Syntax:
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> <html> <head> <title>angular.isNumber()</title> <script src= "//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"> </script> </head> <body ng-app="app" style="text-align:center"> <h1 style="color:green">GeeksforGeeks</h1> <h2>angular.isNumber()</h2> <div ng-controller="geek"> <b>Input1: </b> <span><code> 123 </code></span> <br> <b>IsNumber: </b>{{isNumber1}}<br /><br><br> <b>Input2: </b> <code> "geeksforgeeks" </code> <br> <b>IsNumber:</b> {{isNumber2}} </div> <!-- Script to uses angular.isNumber() Function --> <script> 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); }]); </script> </body> </html> |
chevron_right
filter_none
Output:

Recommended Posts:
- AngularJS | angular.isObject() Function
- AngularJS | angular.isUndefined() Function
- AngularJS | angular.isString() Function
- AngularJS | angular.isDefined() Function
- AngularJS | angular.isDate() Function
- AngularJS | angular.toJson() Function
- AngularJS | angular.element() Function
- AngularJS | angular.isFunction() Function
- AngularJS | angular.isElement() Function
- AngularJS | angular.equals() Function
- AngularJS | angular.isArray() Function
- AngularJS | angular.bind() Function
- AngularJS | angular.bootstrap() Function
- AngularJS | angular.forEach() Function
- AngularJS | angular.lowercase() Function
- AngularJS | angular.uppercase() Function
- How to execute AngularJS controller function on page load ?
- AngularJS | ng-show Directive
- AngularJS | currency Filter
- How to convert string into a number using AngularJS ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

