@klippa/ngx-async-template
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -67,8 +67,13 @@ (function (global, factory) { | ||
} | ||
var originalPromise_1 = this.promise; | ||
this.promise.then(function (res) { | ||
_this.promiseStatus = 'success'; | ||
_this.promiseValue = res; | ||
if (originalPromise_1 === _this.promise) { | ||
_this.promiseStatus = 'success'; | ||
_this.promiseValue = res; | ||
} | ||
}, function (res) { | ||
_this.promiseStatus = 'error'; | ||
_this.promiseErrors = res; | ||
if (originalPromise_1 === _this.promise) { | ||
_this.promiseStatus = 'error'; | ||
_this.promiseErrors = res; | ||
} | ||
}); | ||
@@ -75,0 +80,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("@klippa/ngx-async-template",["exports","@angular/core","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).klippa=e.klippa||{},e.klippa["ngx-async-template"]={}),e.ng.core,e.ng.common)}(this,(function(e,t,n){"use strict";var r=function(){};r.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-all]"}]}];var o=function(){};o.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-inactive]"}]}];var s=function(){};s.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-pending]"}]}];var a=function(){};a.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-success]"}]}];var i=function(){};i.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-error]"}]}];var c=function(){function e(){this.promise=null,this.successStateOnReload=!1,this.promiseStatus="inactive"}return e.prototype.ngOnChanges=function(){var e=this;this.promise?(this.successStateOnReload&&"success"===this.promiseStatus||(this.promiseValue=null,this.promiseStatus="pending"),this.promise.then((function(t){e.promiseStatus="success",e.promiseValue=t}),(function(t){e.promiseStatus="error",e.promiseErrors=t}))):(this.promiseValue=null,this.promiseStatus="inactive")},e}();c.decorators=[{type:t.Component,args:[{selector:"ngx-async-template",template:'<ng-container>\n <ng-container *ngFor="let tpl of allStates?.toArray()" [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ status: promiseStatus, value: promiseValue }"></ng-container>\n <ng-container *ngIf="promiseStatus === \'inactive\'" >\n <ng-container *ngFor="let tpl of inactive?.toArray()" [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ status: promiseStatus }"></ng-container>\n </ng-container>\n <ng-container *ngIf="promiseStatus === \'pending\'">\n <ng-container *ngFor="let tpl of pending?.toArray()" [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ status: promiseStatus }"></ng-container>\n </ng-container>\n <ng-container *ngIf="promiseStatus === \'success\'">\n <ng-container\n *ngFor="let tpl of success?.toArray()"\n [ngTemplateOutlet]="tpl"\n [ngTemplateOutletContext]="{ value: promiseValue, status: promiseStatus }"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf="promiseStatus === \'error\'">\n <ng-container\n *ngFor="let tpl of error?.toArray()"\n [ngTemplateOutlet]="tpl"\n [ngTemplateOutletContext]="{ errorMessages: promiseErrors, status: promiseStatus }"\n ></ng-container>\n </ng-container>\n</ng-container>\n',styles:[":host { display: block; }"]}]}],c.ctorParameters=function(){return[]},c.propDecorators={promise:[{type:t.Input}],successStateOnReload:[{type:t.Input}],allStates:[{type:t.ContentChildren,args:[r,{read:t.TemplateRef}]}],inactive:[{type:t.ContentChildren,args:[o,{read:t.TemplateRef}]}],pending:[{type:t.ContentChildren,args:[s,{read:t.TemplateRef}]}],success:[{type:t.ContentChildren,args:[a,{read:t.TemplateRef}]}],error:[{type:t.ContentChildren,args:[i,{read:t.TemplateRef}]}]};var p=function(){};p.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[c,r,o,s,a,i],exports:[c,r,o,s,a,i]}]}],e.AsyncAllStatesComponent=r,e.AsyncErrorComponent=i,e.AsyncInactiveComponent=o,e.AsyncPendingComponent=s,e.AsyncSuccessComponent=a,e.NgxAsyncTemplateComponent=c,e.NgxAsyncTemplateModule=p,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("@klippa/ngx-async-template",["exports","@angular/core","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).klippa=e.klippa||{},e.klippa["ngx-async-template"]={}),e.ng.core,e.ng.common)}(this,(function(e,t,n){"use strict";var r=function(){};r.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-all]"}]}];var o=function(){};o.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-inactive]"}]}];var s=function(){};s.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-pending]"}]}];var a=function(){};a.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-success]"}]}];var i=function(){};i.decorators=[{type:t.Directive,args:[{selector:"[ngx-async-error]"}]}];var p=function(){function e(){this.promise=null,this.successStateOnReload=!1,this.promiseStatus="inactive"}return e.prototype.ngOnChanges=function(){var e=this;if(this.promise){this.successStateOnReload&&"success"===this.promiseStatus||(this.promiseValue=null,this.promiseStatus="pending");var t=this.promise;this.promise.then((function(n){t===e.promise&&(e.promiseStatus="success",e.promiseValue=n)}),(function(n){t===e.promise&&(e.promiseStatus="error",e.promiseErrors=n)}))}else this.promiseValue=null,this.promiseStatus="inactive"},e}();p.decorators=[{type:t.Component,args:[{selector:"ngx-async-template",template:'<ng-container>\n <ng-container *ngFor="let tpl of allStates?.toArray()" [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ status: promiseStatus, value: promiseValue }"></ng-container>\n <ng-container *ngIf="promiseStatus === \'inactive\'" >\n <ng-container *ngFor="let tpl of inactive?.toArray()" [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ status: promiseStatus }"></ng-container>\n </ng-container>\n <ng-container *ngIf="promiseStatus === \'pending\'">\n <ng-container *ngFor="let tpl of pending?.toArray()" [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ status: promiseStatus }"></ng-container>\n </ng-container>\n <ng-container *ngIf="promiseStatus === \'success\'">\n <ng-container\n *ngFor="let tpl of success?.toArray()"\n [ngTemplateOutlet]="tpl"\n [ngTemplateOutletContext]="{ value: promiseValue, status: promiseStatus }"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf="promiseStatus === \'error\'">\n <ng-container\n *ngFor="let tpl of error?.toArray()"\n [ngTemplateOutlet]="tpl"\n [ngTemplateOutletContext]="{ errorMessages: promiseErrors, status: promiseStatus }"\n ></ng-container>\n </ng-container>\n</ng-container>\n',styles:[":host { display: block; }"]}]}],p.ctorParameters=function(){return[]},p.propDecorators={promise:[{type:t.Input}],successStateOnReload:[{type:t.Input}],allStates:[{type:t.ContentChildren,args:[r,{read:t.TemplateRef}]}],inactive:[{type:t.ContentChildren,args:[o,{read:t.TemplateRef}]}],pending:[{type:t.ContentChildren,args:[s,{read:t.TemplateRef}]}],success:[{type:t.ContentChildren,args:[a,{read:t.TemplateRef}]}],error:[{type:t.ContentChildren,args:[i,{read:t.TemplateRef}]}]};var c=function(){};c.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[p,r,o,s,a,i],exports:[p,r,o,s,a,i]}]}],e.AsyncAllStatesComponent=r,e.AsyncErrorComponent=i,e.AsyncInactiveComponent=o,e.AsyncPendingComponent=s,e.AsyncSuccessComponent=a,e.NgxAsyncTemplateComponent=p,e.NgxAsyncTemplateModule=c,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=klippa-ngx-async-template.umd.min.js.map |
@@ -46,8 +46,13 @@ import { Component, ContentChildren, Directive, Input, TemplateRef } from '@angular/core'; | ||
} | ||
const originalPromise = this.promise; | ||
this.promise.then((res) => { | ||
this.promiseStatus = 'success'; | ||
this.promiseValue = res; | ||
if (originalPromise === this.promise) { | ||
this.promiseStatus = 'success'; | ||
this.promiseValue = res; | ||
} | ||
}, (res) => { | ||
this.promiseStatus = 'error'; | ||
this.promiseErrors = res; | ||
if (originalPromise === this.promise) { | ||
this.promiseStatus = 'error'; | ||
this.promiseErrors = res; | ||
} | ||
}); | ||
@@ -74,2 +79,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWFzeW5jLXRlbXBsYXRlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvbmd4LWFzeW5jLXRlbXBsYXRlLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLGVBQWUsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFhLFdBQVcsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUdyRyxNQUFNLE9BQU8sdUJBQXVCOzs7WUFEbkMsU0FBUyxTQUFDLEVBQUUsUUFBUSxFQUFFLGlCQUFpQixFQUFFOztBQUcxQyxNQUFNLE9BQU8sc0JBQXNCOzs7WUFEbEMsU0FBUyxTQUFDLEVBQUUsUUFBUSxFQUFFLHNCQUFzQixFQUFFOztBQUcvQyxNQUFNLE9BQU8scUJBQXFCOzs7WUFEakMsU0FBUyxTQUFDLEVBQUUsUUFBUSxFQUFFLHFCQUFxQixFQUFFOztBQUc5QyxNQUFNLE9BQU8scUJBQXFCOzs7WUFEakMsU0FBUyxTQUFDLEVBQUUsUUFBUSxFQUFFLHFCQUFxQixFQUFFOztBQUc5QyxNQUFNLE9BQU8sbUJBQW1COzs7WUFEL0IsU0FBUyxTQUFDLEVBQUUsUUFBUSxFQUFFLG1CQUFtQixFQUFFOztBQVE1QyxNQUFNLE9BQU8seUJBQXlCO0lBYXBDO1FBWlMsWUFBTyxHQUFpQixJQUFJLENBQUM7UUFDN0IseUJBQW9CLEdBQVksS0FBSyxDQUFDLENBQUMsOEdBQThHO1FBQ3ZKLGtCQUFhLEdBQWlELFVBQVUsQ0FBQztJQVVqRSxD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gICAgdGhpcy5wcm9taXNlU3RhdHVzID0gJ3N1Y2Nlc3MnO1xuICAgICAgICAgICAgdGhpcy5wcm9taXNlVmFsdWUgPSByZXM7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICAocmVzKSA9PiB7XG4gICAgICAgICAgaWYob3JpZ2luYWxQcm9taXNlID09PSB0aGlzLnByb21pc2UpIHtcbiAgICAgICAgICAgIHRoaXMucHJvbWlzZVN0YXR1cyA9ICdlcnJvcic7XG4gICAgICAgICAgICB0aGlzLnByb21pc2VFcnJvcnMgPSByZXM7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICApO1xuICAgIH1cbiAgfVxufVxuIl19 |
@@ -48,8 +48,13 @@ import { Directive, Component, Input, ContentChildren, TemplateRef, NgModule } from '@angular/core'; | ||
} | ||
const originalPromise = this.promise; | ||
this.promise.then((res) => { | ||
this.promiseStatus = 'success'; | ||
this.promiseValue = res; | ||
if (originalPromise === this.promise) { | ||
this.promiseStatus = 'success'; | ||
this.promiseValue = res; | ||
} | ||
}, (res) => { | ||
this.promiseStatus = 'error'; | ||
this.promiseErrors = res; | ||
if (originalPromise === this.promise) { | ||
this.promiseStatus = 'error'; | ||
this.promiseErrors = res; | ||
} | ||
}); | ||
@@ -56,0 +61,0 @@ } |
{ | ||
"name": "@klippa/ngx-async-template", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "tslib": "^2.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
57002
426