AngularJS tut 19 : API angularJS 0 (0)

AngularJS tut 19 : API angularJS 0 (0)

AngularJS tut 19 : API angularJS 0 (0)

Learn more »

API là viết tắt của Application Programming Interface..


API toàn cầu AngularJS

AngularJS Global API là một tập hợp các hàm JavaScript toàn cầu để thực hiện các tác vụ phổ biến như:

  • So sánh các đối tượng
  • Lặp lại các đối tượng
  • Chuyển đổi dữ liệu

Các hàm API toàn cầu được truy cập bằng cách sử dụng đối tượng góc cạnh.

Dưới đây là danh sách một số hàm API phổ biến:

APISự miêu tả
angle.lowercase ()Chuyển một chuỗi thành chữ thường
angle.uppercase ()Chuyển một chuỗi thành chữ hoa
angle.isString ()Trả về true nếu tham chiếu là một chuỗi
angle.isNumber ()Trả về true nếu tham chiếu là một số

angle.lowercase ()

Thí dụ

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

Hãy tự mình thử »



angle.uppercase ()

Thí dụ

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

Hãy tự mình thử »

angle.isString ()

Thí dụ

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

Hãy tự mình thử »

angle.isNumber ()

Thí dụ

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

Hãy tự mình thử »


Lượt xem : 233

Integrations
Users

Share Profile

Anyone at KeenThemes can view
Anyone with link can edit

Give Award

Anyone at KeenThemes can view
Anyone with link can edit

Report User

Let us know why you’re reporing this person
Don't worry, your report is completely anonymous; the person you're
reporting will not be informed that you've submitted it