Here we will learn what is angular.isNumber with an example. The angular.IsNumber function accepts one parameter and returns a boolean value true or false.

What is angular.isNumber function in Angular JS?

The angular.IsNumber function accepts one parameter and returns a boolean value true or false. If the parameter value is Integer then it returns true otherwise it returns false.

Usage:

angular.isNumber(value);

Example:

<!DOCTYPE html>
<html>

<head>

<title>Angular JS Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

</head>

<body>

<div ng-app="myApp" ng-controller="myCtrl">
<p>{{ value1 }}</p>
<p>{{ value2 }}</p>

<p>{{ value3 }}</p>
</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.value1 = "Vinod";
$scope.value2 = angular.isNumber($scope.x1);

$scope.value3 = angular.isNumber(6);
});
</script>

</body>
</html>

View More:

Conclusion:

I hope this is a useful tutorial for you. Please don’t hesitate to comment for any technical help. Your feedback and suggestions are valuable to me.

Leave a Comment