angular.isNumber: This function is used to check whether a string(reference) is number or not. The function isFunction will return true if passed reference is function else it will return false.
angular.isNumber – Check if string is number | Example
Sytax for angular.isElement is as below-
Syntax –
angular.isNumber Syntax
angular.isNumber(value); |
The above function checks whether the passed string(reference) is number or not.
Arguments
- value : This is reference to check.
Returns
- boolean : Returns true if reference is number else it will return false.
Now let us create a simple example to understand the above function.
Example
angular.isNumber – Validate number Example
<div ng-app="myApp"> <div ng-controller="myController"> <button ng-click="chackVars()">Check Vars</button> <br/> Result for a = {{result1}}<br/> Result for b = {{result2}} </div> </div> |
If you run the above example it will produce the output something like this –