API means Application Programming Interface.

AngularJS API syntax

AngularJS Global API A collection of JavaScript functions for performing common tasks, such as:

Compare objects

Iterate objects

Convert objects

Global API Functions are accessed using angular objects.

Some common API functions are listed below:

APIDescription
angular.lowercase()Convert the string to lowercase
angular.uppercase()Convert the string to uppercase
angular.isString() Determine whether the given object is a string, and return true if so.
angular.isNumber() Determine whether the given object is a number, and return true if so.

AngularJS API example

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>

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

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

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance