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>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 58 | jQuery Mobile | 8년 전 | 2988 | ||
| 57 | jQuery Mobile | 8년 전 | 2032 | ||
| 56 | jQuery Mobile | 8년 전 | 1367 | ||
| 55 | jQuery Mobile | 8년 전 | 1557 | ||
| 54 | jQuery Mobile | 8년 전 | 2239 | ||
| 53 | jQuery Mobile | 8년 전 | 1540 | ||
| 52 | jQuery Mobile | 8년 전 | 1559 | ||
| 51 | jQuery Mobile | 8년 전 | 1427 | ||
| 50 | jQuery Mobile | 8년 전 | 1318 | ||
| 49 | jQuery Mobile | 8년 전 | 1820 | ||
| 48 | jQuery Mobile | 8년 전 | 1462 | ||
| 47 | jQuery Mobile | 8년 전 | 2021 | ||
| 46 | jQuery Mobile | 8년 전 | 1982 | ||
| 45 | jQuery Mobile | 8년 전 | 1514 | ||
| 44 | jQuery Mobile | 8년 전 | 1679 | ||
| 43 | jQuery Mobile | 8년 전 | 1792 | ||
| 42 | jQuery Mobile | 8년 전 | 1668 | ||
| 41 | jQuery Mobile | 8년 전 | 1836 | ||
| 40 | jQuery Mobile | 8년 전 | 1481 | ||
| 39 | jQuery Mobile | 8년 전 | 1635 | ||
| 38 | jQuery Mobile | 8년 전 | 2182 | ||
| 37 | jQuery Mobile | 8년 전 | 2685 | ||
| 36 | jQuery Mobile | 8년 전 | 2137 | ||
| 35 | jQuery Mobile | 8년 전 | 1524 | ||
| 34 | jQuery Mobile | 8년 전 | 2427 | ||
| 33 | AngularJS | 8년 전 | 2877 | ||
| 32 | AngularJS | 8년 전 | 2439 | ||
| 31 | AngularJS | 8년 전 | 1768 | ||
| 30 | AngularJS | 8년 전 | 2844 | ||
| 29 | AngularJS | 8년 전 | 2404 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기