IT

AngularJS #20 - API

금마s 2022. 1. 11. 22:34

✔ AngularJS API

 > API는 Application Programming Interface의 약자다

 

 

1. AngularJS Global API

 > AngularJS Global API는 global JavaScript 함수의 집합이다.

 > Comparing objects, Iterating objects, Converting data와 같은 일을 한다

 > Global API 함수들은 angular object를 통해 접근이 가능하다

 

 

2. Examples

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

 

 

 

** 위 글은 w3schools.com에 있는 내용을 한국어로 번역하여 적어둔 글입니다.

- https://www.w3schools.com/angular/angular_api.asp

 

Angular API

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

 

 

 

 

 

728x90

'IT' 카테고리의 다른 글

ServiceNow Fundamentals  (0) 2022.02.22
AngularJS #19 - Form Validation  (0) 2022.01.11
AngularJS #18 - Forms  (0) 2022.01.08
AngularJS #17 - Events  (0) 2022.01.03
AngularJS #16 - HTML DOM  (0) 2022.01.02