@wellwind/ngx-thanos
Version:
Use [Thanos](https://www.google.com/search?q=Thanos) snap to destory your DOM elements on Angular.
165 lines (156 loc) • 6.2 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@wellwind/thanos-snap'), require('rxjs')) :
typeof define === 'function' && define.amd ? define('@wellwind/ngx-thanos', ['exports', '@angular/common', '@angular/core', '@wellwind/thanos-snap', 'rxjs'], factory) :
(factory((global.wellwind = global.wellwind || {}, global.wellwind['ngx-thanos'] = {}),global.ng.common,global.ng.core,global.thanosSnap,global.rxjs));
}(this, (function (exports,common,i0,thanosSnap,rxjs) { 'use strict';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ThanosSnapService = /** @class */ (function () {
function ThanosSnapService() {
}
/**
* @param {?} target
* @return {?}
*/
ThanosSnapService.prototype.snap = /**
* @param {?} target
* @return {?}
*/
function (target) {
return rxjs.from(thanosSnap.thanosSnap(target));
};
/**
* @param {?} target
* @return {?}
*/
ThanosSnapService.prototype.rewind = /**
* @param {?} target
* @return {?}
*/
function (target) {
return rxjs.from(thanosSnap.thanosRewind(target));
};
ThanosSnapService.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
ThanosSnapService.ctorParameters = function () { return []; };
/** @nocollapse */ ThanosSnapService.ngInjectableDef = i0.defineInjectable({ factory: function ThanosSnapService_Factory() { return new ThanosSnapService(); }, token: ThanosSnapService, providedIn: "root" });
return ThanosSnapService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ThanosSnapDirective = /** @class */ (function () {
function ThanosSnapDirective(elementRef, thanosSnapService) {
this.elementRef = elementRef;
this.thanosSnapService = thanosSnapService;
this.ngxThanosSnap = false;
this.snapStarting = new i0.EventEmitter();
this.snapEnded = new i0.EventEmitter();
this.rewinded = new i0.EventEmitter();
}
Object.defineProperty(ThanosSnapDirective.prototype, "host", {
get: /**
* @return {?}
*/ function () {
return this.elementRef.nativeElement;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
ThanosSnapDirective.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
if (this.ngxThanosSnap) {
this.snap();
}
else {
this.rewind();
}
};
/**
* @return {?}
*/
ThanosSnapDirective.prototype.snap = /**
* @return {?}
*/
function () {
var _this = this;
this.snapStarting.emit();
this.thanosSnapService.snap(this.host).subscribe(( /**
* @return {?}
*/function () { return _this.snapEnded.emit(); }));
};
/**
* @return {?}
*/
ThanosSnapDirective.prototype.rewind = /**
* @return {?}
*/
function () {
var _this = this;
this.thanosSnapService.rewind(this.host).subscribe(( /**
* @return {?}
*/function () { return _this.rewinded.emit(); }));
};
ThanosSnapDirective.decorators = [
{ type: i0.Directive, args: [{
selector: '[ngxThanosSnap]',
exportAs: 'ngxThanosSnap'
},] }
];
/** @nocollapse */
ThanosSnapDirective.ctorParameters = function () {
return [
{ type: i0.ElementRef },
{ type: ThanosSnapService }
];
};
ThanosSnapDirective.propDecorators = {
ngxThanosSnap: [{ type: i0.Input }],
snapStarting: [{ type: i0.Output }],
snapEnded: [{ type: i0.Output }],
rewinded: [{ type: i0.Output }]
};
return ThanosSnapDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxThanosModule = /** @class */ (function () {
function NgxThanosModule() {
}
NgxThanosModule.decorators = [
{ type: i0.NgModule, args: [{
imports: [common.CommonModule],
declarations: [ThanosSnapDirective],
exports: [ThanosSnapDirective]
},] }
];
return NgxThanosModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
exports.NgxThanosModule = NgxThanosModule;
exports.ThanosSnapDirective = ThanosSnapDirective;
exports.ThanosSnapService = ThanosSnapService;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=wellwind-ngx-thanos.umd.js.map