2016년 1월 26일 화요일

[AngularJS] click event (DOM, Angular]


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
<!DOCTYPE html>
<html >
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
  </head>
  <body ng-app='gradeApp' >
  <div ng-controller='GradeController'>
    <button onclick="testDOM()">DOM Event BUTTON</button><br/>
    <button ng-Click="testAngular($event)">Angular BUTTON</button>
  </div>
  <script src="http://code.angularjs.org/1.2.11/angular.min.js"></script>
  <script src="http://code.angularjs.org/1.2.11/angular-sanitize.min.js"></script>
  <script>
  function testDOM(){
    console.log("DOM :::::::::::");
    console.log(event);
  }
 
  var grade  = angular.module('gradeApp',[]); 
  grade.controller('GradeController'function($scope){
    $scope.testAngular = function($event) {
      console.log("AngularJS:::::::::::");
      console.log($event);      
    };   
  }); 
  </script>
  </body>
</html>
 
cs

댓글 없음:

댓글 쓰기