本文整理汇总了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) );
});
}