loadImage()
{
this.isShowDocumentGif=false;
return this._organizations.getLogoUrldocumentmedia(this.documentlist).single().toPromise()
.then(url => {
this.isShowDocumentGif=false;
this._user_img = url;
})
.catch(e => {
this.isShowDocumentGif=false;
console.log('Logo error', e);
throw e;
});
}
答案 0 :(得分:1)
像这样使用
anyFunction(){
this.isShowDocumentGif = true //variable to toggle your loader
return this._organizations.getLogoUrldocumentmedia(this.documentlist).single().toPromise()
.then(url => {
this.isShowDocumentGif=false;
this._user_img = url;
})
.catch(e => {
this.isShowDocumentGif=false;
console.log('Logo error', e);
throw e;
});
}