本文整理匯總了TypeScript中@eg/core/event.service.EventService.parse方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.EventService.parse方法的具體用法?TypeScript service.EventService.parse怎麽用?TypeScript service.EventService.parse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@eg/core/event.service.EventService
的用法示例。
在下文中一共展示了service.EventService.parse方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
resp => {
let result = resp.result;
const holdResult: HoldRequestResult = {success: true};
// API can return an ID, an array of events, or a hash
// of info.
if (Number(result) > 0) {
// On success, the API returns the hold ID.
holdResult.holdId = result;
console.debug(`Hold successfully placed ${result}`);
} else {
holdResult.success = false;
console.info('Hold request failed: ', result);
if (Array.isArray(result)) { result = result[0]; }
if (this.evt.parse(result)) {
holdResult.evt = this.evt.parse(result);
} else {
holdResult.evt = this.evt.parse(result.last_event);
}
}
request.result = holdResult;
return request;
}
示例2:
).subscribe(bktId => {
const evt = this.evt.parse(bktId);
if (evt) {
this.toast.danger(evt.desc);
} else {
this.addToBucket(bktId);
}
});
示例3:
).toPromise().then(resp => {
const evt = this.evt.parse(resp);
if (evt) {
this.toast.danger(evt.toString());
} else {
this.close();
}
});
示例4:
).toPromise().then(async(result) => {
if (Number(result) === 1) {
this.numSucceeded++;
this.toast.success(await this.successMsg.current());
} else {
this.numFailed++;
console.error('Retarget Failed', this.evt.parse(result));
this.toast.warning(await this.errorMsg.current());
}
});
示例5: async
async(result) => {
if (Number(result) === 1) {
this.numSucceeded++;
this.toast.success(await this.successMsg.current());
} else {
this.numFailed++;
console.error(this.evt.parse(result));
this.toast.warning(await this.errorMsg.current());
}
this.cancelNext(ids);
}
示例6:
).toPromise().then(async(result) => {
if (Number(result) === 1) {
this.numSucceeded++;
this.toast.success(await this.successMsg.current());
} else {
this.numFailed++;
console.error('Mark missing failed ', this.evt.parse(result));
this.toast.warning(await this.errorMsg.current());
}
return this.markOneItemMissing(ids);
});
示例7: reject
).subscribe(queue => {
const e = this.evt.parse(queue);
if (e) {
reject(e);
} else {
// createQueue is always called after queues have
// been fetched and cached.
this.allQueues[qType].push(queue);
resolve(queue.id());
}
});