Curriculum
Course: AngularJS
Login

Curriculum

AngularJS

AngularJS Tutorial

0/65
Text lesson

AngularJS API

API stands for Application Programming Interface.

AngularJS Global API

The AngularJS Global API is a collection of global JavaScript functions used for common tasks such as:

  • Comparing objects
  • Iterating over objects
  • Converting data

These Global API functions are accessed via the angular object.

Here are some commonly used API functions:

API

Description

angular.lowercase()

Converts a string to lowercase.

angular.uppercase()

Transforms a string to uppercase.

angular.isString()

Returns true if the provided reference is a string.

angular.isNumber()

Returns true if the given reference is a number.

angular.lowercase()

Example

<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>

angular.uppercase()

Example

<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.uppercase($scope.x1);
});
</script>

angular.isString()

Example

<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.isString($scope.x1);
});
</script>

angular.isNumber()

Example

<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.isNumber($scope.x1);
});
</script>