當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript service.EventService.parse方法代碼示例

本文整理匯總了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;
            }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:28,代碼來源:holds.service.ts

示例2:

 ).subscribe(bktId => {
     const evt = this.evt.parse(bktId);
     if (evt) {
         this.toast.danger(evt.desc);
     } else {
         this.addToBucket(bktId);
     }
 });
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:8,代碼來源:record-bucket-dialog.component.ts

示例3:

 ).toPromise().then(resp => {
     const evt = this.evt.parse(resp);
     if (evt) {
         this.toast.danger(evt.toString());
     } else {
         this.close();
     }
 });
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:8,代碼來源:record-bucket-dialog.component.ts

示例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());
     }
 });
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:10,代碼來源:transfer-dialog.component.ts

示例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);
 }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:11,代碼來源:cancel-dialog.component.ts

示例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);
 });
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:11,代碼來源:mark-missing-dialog.component.ts

示例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());
     }
 });
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:11,代碼來源:vandelay.service.ts


注:本文中的@eg/core/event.service.EventService.parse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。