UNPKG

ng2-encrm-components

Version:
36 lines 1.35 kB
"use strict"; var core_1 = require('@angular/core'); var OffClickDirective = (function () { function OffClickDirective() { } /* tslint:enable */ OffClickDirective.prototype.onClick = function ($event) { $event.stopPropagation(); }; OffClickDirective.prototype.ngOnInit = function () { var _this = this; setTimeout(function () { document.addEventListener('click', _this.offClickHandler); }, 0); }; OffClickDirective.prototype.ngOnDestroy = function () { document.removeEventListener('click', this.offClickHandler); }; __decorate([ core_1.Input('offClick'), __metadata('design:type', Object) ], OffClickDirective.prototype, "offClickHandler", void 0); __decorate([ core_1.HostListener('click', ['$event']), __metadata('design:type', Function), __metadata('design:paramtypes', [MouseEvent]), __metadata('design:returntype', void 0) ], OffClickDirective.prototype, "onClick", null); OffClickDirective = __decorate([ core_1.Directive({ selector: '[offClick]' }), __metadata('design:paramtypes', []) ], OffClickDirective); return OffClickDirective; }()); exports.OffClickDirective = OffClickDirective; //# sourceMappingURL=off-click.js.map