AngularJS API
API means Application Programming Interface.
AngularJS Global API
AngularJS global API is a collection of JavaScript functions used to perform common tasks, such as:
Comparison object
Iterative objects
Convert object
Global API functions are accessed using angular objects.
Here are some common API functions:
API | describe |
---|---|
() | Convert string to lowercase |
() | Convert string to uppercase |
() | Determines whether the given object is a string, and returns true if it is. |
() | Determines whether the given object is a number, and returns true if it is. |
()
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="/libs//1.4.6/"></script> </head> <body> <div ng-app="myApp" ng-controller="myCtrl"> <p>{{ x1 }}</p> <p>{{ x2 }}</p> </div> <script> var app = ('myApp', []); ('myCtrl', function($scope) { $scope.x1 = "JOHN"; $scope.x2 = ($scope.x1); }); </script> </body> </html>
Operation results:
JOHN
john
()
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="/libs//1.4.6/"></script> </head> <body> <div ng-app="myApp" ng-controller="myCtrl"> <p>{{ x1 }}</p> <p>{{ x2 }}</p> </div> <script> var app = ('myApp', []); ('myCtrl', function($scope) { $scope.x1 = "JOHN"; $scope.x2 = ($scope.x1); }); </script> </body> </html>
Operation results:
JOHN
true
()
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="/libs//1.4.6/"></script> </head> <body> <div ng-app="myApp" ng-controller="myCtrl"> <p>{{ x1 }}</p> <p>{{ x2 }}</p> </div> <script> var app = ('myApp', []); ('myCtrl', function($scope) { $scope.x1 = "JOHN"; $scope.x2 = ($scope.x1); }); </script> </body> </html>
Operation results:
JOHN
true
()
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="/libs//1.4.6/"></script> </head> <body> <div ng-app="myApp" ng-controller="myCtrl"> <p>{{ x1 }}</p> <p>{{ x2 }}</p> </div> <script> var app = ('myApp', []); ('myCtrl', function($scope) { $scope.x1 = "JOHN"; $scope.x2 = ($scope.x1); }); </script> </body> </html>
Operation results:
JOHN
false
The above is a compilation of AngularJS API (interface) data, and will be supplemented later. I hope that students who can help with programming.