2 * Created by ob0695 on 5/15/2018.
6 export class PreventDoubleClickDirective implements ng.IDirective {
8 constructor(private $timeout:ng.ITimeoutService) {
13 link = (scope, elem) => {
18 scope.onClick = (evt) => {
21 evt.stopImmediatePropagation();
24 this.$timeout(function () {
30 scope.$on('$destroy', function () {
31 elem.off('click', scope.onClick);
33 elem.on('click', scope.onClick);
36 public static factory = ($timeout:ng.ITimeoutService) => {
37 return new PreventDoubleClickDirective($timeout);
41 PreventDoubleClickDirective.factory.$inject = ['$timeout'];