UNPKG

ngx-tree-select

Version:

Angular component for select with tree items.

59 lines 1.8 kB
import { Directive, Inject, Input, PLATFORM_ID } from '@angular/core'; import { isPlatformBrowser } from '@angular/common'; var OffClickDirective = /** @class */ (function () { /** * @param {?} platformId */ function OffClickDirective(platformId) { this.platformId = platformId; } /** * @return {?} */ OffClickDirective.prototype.ngOnInit = function () { var _this = this; if (isPlatformBrowser(this.platformId)) { setTimeout(function () { document.addEventListener('click', _this.offClickHandler); }, 0); } }; /** * @return {?} */ OffClickDirective.prototype.ngOnDestroy = function () { if (isPlatformBrowser(this.platformId)) { document.removeEventListener('click', this.offClickHandler); } }; OffClickDirective.decorators = [ { type: Directive, args: [{ selector: '[off-click]' },] }, ]; /** * @nocollapse */ OffClickDirective.ctorParameters = function () { return [ { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] },] }, ]; }; OffClickDirective.propDecorators = { 'offClickHandler': [{ type: Input, args: ['off-click',] },], }; return OffClickDirective; }()); export { OffClickDirective }; function OffClickDirective_tsickle_Closure_declarations() { /** @type {?} */ OffClickDirective.decorators; /** * @nocollapse * @type {?} */ OffClickDirective.ctorParameters; /** @type {?} */ OffClickDirective.propDecorators; /** @type {?} */ OffClickDirective.prototype.offClickHandler; /** @type {?} */ OffClickDirective.prototype.platformId; } //# sourceMappingURL=off-click.directive.js.map