本文整理匯總了TypeScript中src/app/_services/api.service.ApiService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.ApiService類的具體用法?TypeScript service.ApiService怎麽用?TypeScript service.ApiService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了service.ApiService類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: listPos
listPos() {
this.loading = true;
this.api.getPos().subscribe((data: any) => {
this.loading = false;
if ( this.global.is200(data) ) {
this.pos = data['body']['data'];
}
}, err => this.global.handleError(err) );
}
示例2:
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) );
});
示例3: onSubmit
onSubmit() {
if (this.form.invalid) {
return;
}
this.generic.showLoading('Verificando datos...');
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) );
}