Tutorial 24 - AngularJS Global API

Hơ to use AngularJS Global API

 This tutorial provides samples to help you know how to use following common API: angular.isString(),angular.isNumber(),angular.lowercase() and angular.uppercase().

•    How to use angular.isString().
This sample will help you know about using angular.isString() in AngularJS



 <html>  
   <head>  
     <title>Angular JS Model</title>  
     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
     <script>  
 var app = angular.module('MyForm', []);  
 app.controller('myCtrl', function($scope) {  
 $scope.a = "AngularJSAZ";  
 $scope.b = angular.isString($scope.a);  
 });  
     </script>  
   </head>  
   <body ng-app="MyForm">  
 <div ng-controller="myCtrl">  
 <p>{{ a }}</p>  
 <p>{{ b }}</p>  
 </div>  
 </body>  
  </html>  

•    How to use angular.isNumber()
This sample will help you know about using angular.isNumber() in AngularJS

 <html>  
   <head>  
     <title>Angular JS Model</title>  
     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
     <script>  
 var app = angular.module('MyForm', []);  
 app.controller('myCtrl', function($scope) {  
 $scope.a = "AngularJSAZ";  
 $scope.b = angular.isNumber($scope.a);  
 });  
     </script>  
   </head>  
   <body ng-app="MyForm">  
 <div ng-controller="myCtrl">  
 <p>{{ a }}</p>  
 <p>{{ b }}</p>  
 </div>  
   </body>  
  </html>  

•    How to use angular.lowercase().

This sample will help you know about using angular.lowercase() in AngularJS

 <html>  
   <head>  
     <title>Angular JS Model</title>  
     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
     <script>  
 var app = angular.module('MyForm', []);  
 app.controller('myCtrl', function($scope) {  
 $scope.a = "AngularJSAZ";  
 $scope.b = angular.lowercase($scope.a);  
 });  
     </script>  
   </head>  
   <body ng-app="MyForm">  
 <div ng-controller="myCtrl">  
 <p>{{ a }}</p>  
 <p>{{ b }}</p>  
 </div>  
   </body>  
  </html>  

•    How to use angular.uppercase ().

 This sample will help you know about using angular.uppercase() in AngularJS  
 <html>  
   <head>  
     <title>Angular JS Model</title>  
     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
     <script>  
 var app = angular.module('MyForm', []);  
 app.controller('myCtrl', function($scope) {  
 $scope.a = "AngularJSAZ";  
 $scope.b = angular.uppercase($scope.a);  
 });  
    </script>  
   </head>  
   <body ng-app="MyForm">  
 <div ng-controller="myCtrl">  
 <p>{{ a }}</p>  
 <p>{{ b }}</p>  
 </div>  
   </body>  
  </html>  


1 comment:

Popular Posts