ngx-address
Version:
A simple address picker in angular.
35 lines • 1.29 kB
JavaScript
import { Directive, Input, HostListener } from '@angular/core';
var OffClickDirective = (function () {
function OffClickDirective() {
}
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);
}
};
OffClickDirective.decorators = [
{ type: Directive, args: [{
selector: '[offClick]'
},] },
];
/** @nocollapse */
OffClickDirective.ctorParameters = function () { return []; };
OffClickDirective.propDecorators = {
"offClickHandler": [{ type: Input, args: ['offClick',] },],
"onClick": [{ type: HostListener, args: ['click', ['$event'],] },],
};
return OffClickDirective;
}());
export { OffClickDirective };
//# sourceMappingURL=off-click.js.map