API là viết tắt của Application Programming Interface..
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ư:
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:
| API | Sự 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ố |
<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> <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> <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> <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>
Lượt xem : 233
This is excellent news!
Haven't seen the build yet, I'll look now.
Checking the build now