标签:alert html angular comment bsp rect 事件 event code
<input ng-keyup="event=$event">
//<p>event keyCode: {{ event.keyCode }}</p>
//<p>event altKey: {{ event.shiftKey }}</p>
myApp.directive(
‘ngEnter‘
,
function
() {
return
function
(scope, element, attrs) {
element.bind(
"keydown keypress"
,
function
(event) {
if
(event.which === 13) {
scope.$apply(
function
() {
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
});
};
});
$scope.shirtKeyCheck=
function
($event){
if
($event.keyCode==13){
//回车13,shift键为16
alert(‘按下了回车键‘);
}
}
标签:alert html angular comment bsp rect 事件 event code
原文地址:http://www.cnblogs.com/bertha-zm/p/7462805.html