本文整理匯總了TypeScript中src/app/_services/global.service.GlobalService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.GlobalService類的具體用法?TypeScript service.GlobalService怎麽用?TypeScript service.GlobalService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了service.GlobalService類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.api.closeTurn(pos).subscribe((data: any) => {
this.loading = false;
if ( this.global.is201(data) ) {
this.toast.success({title: 'Excelente!', message: this.global.getMessage(data)});
this.listPos();
} else {
this.global.showError(this.global.getMessage(data));
}
}, err => this.global.handleError(err) );
示例2:
this.api.getLogin(this.form.value).subscribe((data) => {
this.generic.hideLoading();
if ( this.generic.is200(data) ) {
if ( this.generic.isSuccess(data) ) {
localStorage.setItem('token', data.body['data']['token']);
this._route.navigate(['/']);
} else {
this.generic.showError(this.generic.getMessage(data));
}
}
}, err => this.generic.handleError(err) );
示例3: onClickCloseTurn
onClickCloseTurn(pos: any) {
this.global.showConfirm('Tu turno serรก cerrado', () => {
this.loading = true;
this.api.closeTurn(pos).subscribe((data: any) => {
this.loading = false;
if ( this.global.is201(data) ) {
this.toast.success({title: 'Excelente!', message: this.global.getMessage(data)});
this.listPos();
} else {
this.global.showError(this.global.getMessage(data));
}
}, err => this.global.handleError(err) );
});
}
示例4: onClickOpenPos
onClickOpenPos(pos: any) {
this.global.showConfirm('La caja serรก abierta para iniciar sus operaciones', () => {
this.loading = true;
this.api.openPos(pos).subscribe((data: any) => {
this.loading = false;
if ( this.global.is201(data) ) {
this.toast.success({title: 'Excelente!', message: this.global.getMessage(data)});
this.listPos();
} else {
this.global.showError(this.global.getMessage(data));
}
}, err => this.global.handleError(err) );
});
}