WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

AngularJS API


API means A pplication P rogramming I nterface (application programming interface).


AngularJS global API

A collection of JavaScript functions used by the AngularJS global API to perform common tasks, such as:

  • Comparison
  • Iterating objects
  • Conversion object

Global API functions are accessed using angular objects.

Here are some common API functions:

Types API functions:

API Description
angular.lowercase (<angular1.7)
angular. $$ lowercase () (angular1.7 +)
Convert string to lowercase
angular.uppercase () (<angular1.7)
angular. $$ uppercase () (angular1.7 +)
Convert string to uppercase
angular.isString () Determines whether the given object is a string, and returns true if it is.
angular.isNumber () Determines whether the given object is a number and returns true if it is.

angular.lowercase()

Example

<div ng-app="myApp" ng-controller="myCtrl">
<p>{{ x1 }}</p>
<p>{{ x2 }}</p>
</div>

<script>
var application = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.x1 = "JOHN";
$scope.x2 = angular.lowercase($scope.x1);
});
</script>
Try it Yourself »

angular.uppercase()

Example

<div ng-app="myApp" ng-controller="myCtrl">
<p>{{ x1 }}</p>
<p>{{ x2 }}</p>
</div>

<script>
var application = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.x1 = "John";
$scope.x2 = angular.uppercase($scope.x1);
});
</script>
Try it Yourself »

angular.isString()

Example

<div ng-app="myApp" ng-controller="myCtrl">
<p>{{ x1 }}</p>
<p>{{ x2 }}</p>
</div>

<script>
var application = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.x1 = "JOHN";
$scope.x2 = angular.isString($scope.x1);
});
</script>
Try it Yourself »

angular.isNumber()

Example

<div ng-app="myApp" ng-controller="myCtrl">
<p>{{ x1 }}</p>
<p>{{ x2 }}</p>
</div>

<script>
var application = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.x1 = "JOHN";
$scope.x2 = angular.isNumber($scope.x1);
});
</script>
Try it Yourself »