AngularJS Directives(지시문) - 데이터 바인딩
AngularJS Directives(지시문) - 데이터 바인딩
데이터 바인딩
{{ firstName }}식은, 위의 예에서는 식 바인딩 AngularJS와 데이터이다.
AngularJS의 데이터 바인딩은 AngularJS 표현식을 AngularJS 데이터와 바인딩합니다.
{{ firstName }}에 묶여있다 ng-model="firstName".
다음 예제에서는 두 개의 텍스트 필드가 두 개의 ng-model 지시문과 함께 바인딩됩니다.
<div ng-app="" ng-init="quantity=1;price=5">
Quantity: <input type="number" ng-model="quantity">
Costs: <input type="number" ng-model="price">
Total in dollar: {{ quantity * price }}
</div>
소스
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div data-ng-app="" data-ng-init="quantity=1;price=5">
<h2>Cost Calculator</h2>
Quantity: <input type="number" ng-model="quantity">
Price: <input type="number" ng-model="price">
<p><b>Total in dollar:</b> {{quantity * price}}</p>
</div>
</body>
</html>
데이터 바인딩
{{ firstName }}식은, 위의 예에서는 식 바인딩 AngularJS와 데이터이다.
AngularJS의 데이터 바인딩은 AngularJS 표현식을 AngularJS 데이터와 바인딩합니다.
{{ firstName }}에 묶여있다 ng-model="firstName".
다음 예제에서는 두 개의 텍스트 필드가 두 개의 ng-model 지시문과 함께 바인딩됩니다.
<div ng-app="" ng-init="quantity=1;price=5">
Quantity: <input type="number" ng-model="quantity">
Costs: <input type="number" ng-model="price">
Total in dollar: {{ quantity * price }}
</div>
소스
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div data-ng-app="" data-ng-init="quantity=1;price=5">
<h2>Cost Calculator</h2>
Quantity: <input type="number" ng-model="quantity">
Price: <input type="number" ng-model="price">
<p><b>Total in dollar:</b> {{quantity * price}}</p>
</div>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 118 | jQuery Mobile | 8년 전 | 1349 | ||
| 117 | jQuery Mobile | 8년 전 | 1600 | ||
| 116 | jQuery Mobile | 8년 전 | 1831 | ||
| 115 | jQuery Mobile | 8년 전 | 1784 | ||
| 114 | jQuery Mobile | 8년 전 | 1972 | ||
| 113 | jQuery Mobile | 8년 전 | 1882 | ||
| 112 | jQuery Mobile | 8년 전 | 2490 | ||
| 111 | jQuery Mobile | 8년 전 | 1795 | ||
| 110 | jQuery Mobile | 8년 전 | 1586 | ||
| 109 | jQuery Mobile | 8년 전 | 1749 | ||
| 108 | jQuery Mobile | 8년 전 | 1974 | ||
| 107 | jQuery Mobile | 8년 전 | 1774 | ||
| 106 | jQuery Mobile | 8년 전 | 1455 | ||
| 105 | jQuery Mobile | 8년 전 | 1756 | ||
| 104 | jQuery Mobile | 8년 전 | 2434 | ||
| 103 | jQuery Mobile | 8년 전 | 1564 | ||
| 102 | jQuery Mobile | 8년 전 | 1507 | ||
| 101 | jQuery Mobile | 8년 전 | 1701 | ||
| 100 | jQuery Mobile | 8년 전 | 1924 | ||
| 99 | jQuery Mobile | 8년 전 | 1383 | ||
| 98 | jQuery Mobile | 8년 전 | 1407 | ||
| 97 | jQuery Mobile | 8년 전 | 1664 | ||
| 96 | jQuery Mobile | 8년 전 | 1315 | ||
| 95 | jQuery Mobile | 8년 전 | 1128 | ||
| 94 | jQuery Mobile | 8년 전 | 1531 | ||
| 93 | jQuery Mobile | 8년 전 | 1149 | ||
| 92 | jQuery Mobile | 8년 전 | 1573 | ||
| 91 | jQuery Mobile | 8년 전 | 1524 | ||
| 90 | jQuery Mobile | 8년 전 | 1689 | ||
| 89 | jQuery Mobile | 8년 전 | 1668 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기