Runoob Tutorial ArchiveEnglish

AngularJS API

AngularJS API


API meansApplicationProgrammingIInterface (Application Programming Interface).


AngularJS Global API

A set of JavaScript functions in the AngularJS Global API to perform common tasks, such as:

Global API functions are accessed using the angular object.

Some general API functions are listed below:

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() Checks if the given object is a string, returns true if it is.
angular.isNumber() Checks if the given object is a number, returns true if it is.

**Note:** The angular.lowercase and angular.uppercase methods were removed after AngularJS 1.7, replaced by angular.$$lowercase and angular.$$uppercase


angular.lowercase()

Instance

<

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 = "RUNOOB"; $scope.x2 = angular.$$lowercase($scope.x1); });

</

script

Try it »

angular.uppercase()

Instance

<

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 = "runoob"; $scope.x2 = angular.$$uppercase($scope.x1); });

</

script

​

Try it »

angular.isString()

Instance

<

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 = "RUNOOB";

$scope.x2 = angular.isString($scope.x1);

});

<

/script

Try it »

angular.isNumber()

Instance

<

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 = "RUNOOB";

$scope.x2 = angular.isNumber($scope.x1);

});

<

/script

Try it »