UNPKG

bm-ng2-select

Version:

ng2-select Botmetric implementation Multi select

35 lines (34 loc) 1.2 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 () { if (typeof document !== 'undefined') { document.addEventListener('click', _this.offClickHandler); } }, 0); }; OffClickDirective.prototype.ngOnDestroy = function () { if (typeof document !== 'undefined') { document.removeEventListener('click', this.offClickHandler); } }; return OffClickDirective; }()); OffClickDirective.decorators = [ { type: core_1.Directive, args: [{ selector: '[offClick]' },] }, ]; /** @nocollapse */ OffClickDirective.ctorParameters = function () { return []; }; OffClickDirective.propDecorators = { 'offClickHandler': [{ type: core_1.Input, args: ['offClick',] },], 'onClick': [{ type: core_1.HostListener, args: ['click', ['$event'],] },], }; exports.OffClickDirective = OffClickDirective;