事件

angular 中绑定事件是使用指令的行事来绑定

ng-click

绑定 click 事件 : 单击
<div ng-app="myApp" ng-controller="myAppCon">
	<p ng-click="click()">绑定单击事件</p>
	<p>单击次数 {{ number }} </p>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.number = 0;
			$scope.click = function(){
					$scope.number++;
				}
			}]);
</script>

ng-dblclick

绑定 dblclick 事件 : 双击
<div ng-app="myApp" ng-controller="myAppCon">
	<button ng-dblclick="dblclick()">
		绑定双击事件
	</button>
	<p>双击次数 {{ number }} </p>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.number = 0;
			$scope.dblclick = function(){
					$scope.number++;
				}
			}]);
</script>

ng-keydown

键盘按下
<div ng-app="myApp" ng-controller="myAppCon">
	<input type="text" ng-keydown="keydown()">
	<p>键盘在输入框按下的次数  {{ number }} </p>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.number = 0;
			$scope.keydown = function(){
					$scope.number++;
				}
			}]);
</script>

ng-keyup

键盘按上
<div ng-app="myApp" ng-controller="myAppCon">
	<input type="text" ng-keyup="keyup()">
	<p>键盘在输入框按上的次数  {{ number }} </p>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.number = 0;
			$scope.keyup = function(){
					$scope.number++;
				}
			}]);
</script>

ng-mousedown

鼠标按下
<div ng-app="myApp" ng-controller="myAppCon">
	<div ng-mousedown="mousedown();">
		鼠标按下次数 {{ number }}
	</div>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.number = 0;
			$scope.mousedown = function(){
					$scope.number++;
				}
			}]);
</script>

ng-mouseup

鼠标松开
<div ng-app="myApp" ng-controller="myAppCon">
	<div ng-mouseup="mouseup();">
		鼠标按下后松开的次数 <em>{{ number }}</em>
	</div>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.number = 0;
			$scope.mouseup = function(){
					$scope.number++;
				}
			}]);
</script>

ng-cut

快捷键  剪切功能
<div ng-app="myApp" ng-controller="myAppCon">
	<input type="text" value="" ng-cut="cut()">
	<div> 是否使用了剪切组合键 {{ cutstate }} </div>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.cutstate = false;
			$scope.cut = function(){
					$scope.cutstate = true;
				}
			}]);
</script>

ng-copy

快捷键  复制功能
<div ng-app="myApp" ng-controller="myAppCon">
	<input type="text" value="" ng-copy="copy()">
	<div>
		是否使用了复制组合键 {{ cutstate }}
	</div>
</div>
<script>
	angular.module('myApp', [])
		.controller('myAppCon',['$scope',function($scope){
			$scope.cutstate = false;
			$scope.copy = function(){
					$scope.cutstate = true;
				}
			}]);
</script>