AngularJS ng-click 지시문
AngularJS ng-click 지시문
이 ng-click 지시자는 요소가 클릭 될 때 실행될 AngularJS 코드를 정의합니다.
예
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="count = count + 1">Click me!</button>
<p>{{ count }}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.count = 0;
});
</script>
예)
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="count = count + 1">Click Me!</button>
<p>{{ count }}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.count = 0;
});
</script>
</body>
</html>
이 ng-click 지시자는 요소가 클릭 될 때 실행될 AngularJS 코드를 정의합니다.
예
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="count = count + 1">Click me!</button>
<p>{{ count }}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.count = 0;
});
</script>
예)
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="count = count + 1">Click Me!</button>
<p>{{ count }}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.count = 0;
});
</script>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 208 | 부트스트랩 | 8년 전 | 2727 | ||
| 207 | AngularJS | 8년 전 | 1471 | ||
| 206 | AngularJS | 8년 전 | 1116 | ||
| 205 | AngularJS | 8년 전 | 988 | ||
| 204 | AngularJS | 8년 전 | 1391 | ||
| 203 | AngularJS | 8년 전 | 1185 | ||
| 202 | AngularJS | 8년 전 | 1500 | ||
| 201 | AngularJS | 8년 전 | 1452 | ||
| 200 | AngularJS | 8년 전 | 1429 | ||
| 199 | AngularJS | 8년 전 | 1347 | ||
| 198 | AngularJS | 8년 전 | 1232 | ||
| 197 | AngularJS | 8년 전 | 1393 | ||
| 196 | AngularJS | 8년 전 | 1046 | ||
| 195 | AngularJS | 8년 전 | 1261 | ||
| 194 | AngularJS | 8년 전 | 1270 | ||
| 193 | AngularJS | 8년 전 | 1616 | ||
| 192 | AngularJS | 8년 전 | 1362 | ||
| 191 | AngularJS | 8년 전 | 1589 | ||
| 190 | AngularJS | 8년 전 | 1555 | ||
| 189 | AngularJS | 8년 전 | 1648 | ||
| 188 | AngularJS | 8년 전 | 1404 | ||
| 187 | AngularJS | 8년 전 | 1370 | ||
| 186 | AngularJS | 8년 전 | 1412 | ||
| 185 | AngularJS | 8년 전 | 1443 | ||
| 184 | AngularJS | 8년 전 | 1483 | ||
| 183 | AngularJS | 8년 전 | 1481 | ||
| 182 | AngularJS | 8년 전 | 1009 | ||
| 181 | AngularJS | 8년 전 | 1390 | ||
| 180 | AngularJS | 8년 전 | 1279 | ||
| 179 | AngularJS | 8년 전 | 1257 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기