AngularJS | API - GeeksforGeeks

30 Apr, 2019
AngularJS APIs are used for comparing, iterating and converting objects.Basic AngularJS API includes
angular.isString()
angular.lowercase()
angular.uppercase()
angular.isNumber()
1. angular.isString()It is used to check whether an object is a string or not.It returns true if the object is string otherwise false.Example:
<!-- Write HTML code here --><!DOCTYPE html><html>  <head><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>  </head>  <body>      <div ng-app="gfg" ng-controller="gfgCntrl">    <p>{{ object }}</p>    <p>{{ apiRes }}</p>    </div>      <script>      var app = angular.module('gfg', []);      app.controller('gfgCntrl', function($scope) {          $scope.object = "GeeksForGeeks";          $scope.apiRes = angular.isString($scope.object);      });    </script>    </body></html>
Output:
2. angular.lowercase()It is used to convert all the characters of the string into lowercase characters.Example:
<!-- Write HTML code here --><!DOCTYPE html><html>  <head><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>  </head>  <body>      <div ng-app="gfg" ng-controller="gfgCntrl">    <p>{{ object }}</p>    <p>{{ apiRes }}</p>    </div>      <script>      var app = angular.module('gfg', []);      app.controller('gfgCntrl', function($scope) {          $scope.object = "GeeksForGeeks";          $scope.apiRes = angular.lowercase($scope.object);      });    </script>    </body></html>
Output:
3. angular.uppercase()It is used to convert all the characters of the string into uppercase characters.Example:
<!-- Write HTML code here --><!DOCTYPE html><html>  <head><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>  </head>  <body>      <div ng-app="gfg" ng-controller="gfgCntrl">    <p>{{ object }}</p>    <p>{{ apiRes }}</p>    </div>      <script>      var app = angular.module('gfg', []);      app.controller('gfgCntrl', function($scope) {          $scope.object = "GeeksForGeeks";          $scope.apiRes = angular.uppercase($scope.object);      });    </script>    </body></html>
Output:
4. angular.isNumber()It is used to check whether an object is a number or not. It returns true if object is a number otherwise false.Example:
<!-- Write HTML code here --><!DOCTYPE html><html>  <head><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>  </head>  <body>      <div ng-app="gfg" ng-controller="gfgCntrl">    <p>{{ object }}</p>    <p>{{ apiRes }}</p>    </div>      <script>      var app = angular.module('gfg', []);      app.controller('gfgCntrl', function($scope) {          $scope.object = "GeeksForGeeks";          $scope.apiRes = angular.isNumber($scope.object);      });    </script>    </body></html>
Output:
Picked
AngularJS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Angular File Upload
Top 10 Angular Libraries For Web Developers
Angular | keyup event
Auth Guards in Angular 9/10/11
What is AOT and JIT Compiler in Angular ?
Roadmap to Become a Web Developer in 2022
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to fetch data from an API in ReactJS ?
Installation of Node.js on Linux
Convert a string to an integer in JavaScript