JS
angular.module('my-app', []).controller('Ctrl', function ($scope, $timeout) {
var t;
$scope.click = function () {
t = $timeout(function () {
alert('click');
}, 1000);
};
$scope.dblclick = function () {
$timeout.cancel(t);
alert('dblclick');
};
});
模板
<div ng-app='my-app' ng-controller='Ctrl'>
<button ng-click='click()' ng-dblclick='dblclick()'>push</button>
</div>
提琴手