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


TypeScript IQService.reject方法代碼示例

本文整理匯總了TypeScript中angular.IQService.reject方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IQService.reject方法的具體用法?TypeScript IQService.reject怎麽用?TypeScript IQService.reject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular.IQService的用法示例。


在下文中一共展示了IQService.reject方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('sets appropriate flags when task load fails', function() {
   spyOn(TaskReader, 'getTasks').and.returnValue($q.reject(null));
   configureApplication();
   expect(application.getDataSource('tasks').loaded).toBe(false);
   expect(application.getDataSource('tasks').loading).toBe(false);
   expect(application.getDataSource('tasks').loadFailure).toBe(true);
 });
開發者ID:mizzy,項目名稱:deck,代碼行數:7,代碼來源:task.dataSource.spec.ts

示例2: fetchBasket

  fetchBasket(): IPromise<IBasket> {
    const basket = this.localStorageService.get('basket');

    if (basket) {
      return this.$q.resolve(basket);
    } else {
      return this.$q.reject({msg: 'No basket found in local storage'});
    }
  }
開發者ID:lunches-platform,項目名稱:fe,代碼行數:9,代碼來源:basket.ts

示例3:

 (response: IHttpPromiseCallbackArg<any>) => {
   const error: any = {
     status: response.status,
     message: response.statusText
   };
   if (response.data && response.data.message) {
     error.log = response.data.message;
   } else {
     error.log = 'Sorry, no more information.';
   }
   return this.$q.reject(error);
 }
開發者ID:jcwest,項目名稱:deck,代碼行數:12,代碼來源:taskExecutor.ts

示例4: listMasters

 public listMasters(type: BuildServiceType = null): IPromise<string[]> {
   const allMasters: IPromise<string[]> = this.API.one('v2').one('builds').get();
   if (!allMasters) {
     return this.$q.reject('An error occurred when retrieving build masters');
   }
   switch (type) {
     case BuildServiceType.Jenkins:
       return allMasters.then(masters => masters.filter(master => !(/^travis-/.test(master))));
     case BuildServiceType.Travis:
       return allMasters.then(masters => masters.filter(master => /^travis-/.test(master)));
     default:
       return allMasters;
   }
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:14,代碼來源:igor.service.ts

示例5: it

    it('sets advanced mode when metrics fail to load', () => {
      alarm = makeAlarm('AWS/EC2', 'CPUUtilization', 'GreaterThanThreshold', [
        {
          name: 'AutoScalingGroupName',
          value: 'asg-v000',
        },
      ]);
      serverGroup = makeServerGroup('asg-v000');

      initialize();
      spyOn(CloudMetricsReader, 'listMetrics').and.returnValue($q.reject(null));

      $ctrl.$onInit();
      $scope.$digest();

      expect($ctrl.state.metricsLoaded).toBe(true);
      expect($ctrl.state.advancedMode).toBe(true);
    });
開發者ID:mizzy,項目名稱:deck,代碼行數:18,代碼來源:metricSelector.component.spec.ts

示例6: transRejected

  transRejected(error): (StateDeclaration|IPromise<any>) {
    let {transition, $state, $stateParams, $q} = this;
    // Handle redirect and abort
    if (error instanceof TransitionRejection) {
      if (error.type === RejectType.IGNORED) {
        // Update $stateParmas/$state.params/$location.url if transition ignored, but dynamic params have changed.
        let dynamic = $state.$current.parameters().filter(prop('dynamic'));
        if (!Param.equals(dynamic, $stateParams, transition.params())) {
          this.updateStateParams();
        }
        return $state.current;
      }

      if (error.type === RejectType.SUPERSEDED && error.redirected && error.detail instanceof TargetState) {
        return this._redirectMgr(transition.redirect(error.detail)).runTransition();
      }
    }

    this.$transitions.defaultErrorHandler()(error);

    return $q.reject(error);
  }
開發者ID:8dspaces,項目名稱:Flask-Scaffold,代碼行數:22,代碼來源:transitionManager.ts

示例7: Error

 promise = promise.then(() => {
   const error: Error & { level?: string } = new Error($i18next.t('Loadouts.TooManyRequested', { total: totalAmount, itemname: item.name, requested: pseudoItem.amount }));
   error.level = 'warn';
   return $q.reject(error);
 });
開發者ID:delphiactual,項目名稱:DIM,代碼行數:5,代碼來源:loadout.service.ts

示例8:

 .catch(err => {
     this.$log.error(err);
     this.$q.reject("Unable to save data");
 });
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:4,代碼來源:sample.service.ts

示例9: function

 getData: function (): IPromise<any> | IPerson[] {
     if ((tp.settings().getData as jasmine.Spy).calls.count() > 1) {
         return $q.reject('BANG!');
     }
     return [{ age: 1 }]
 }
開發者ID:Timeyit,項目名稱:main,代碼行數:6,代碼來源:tableSpec.spec.ts


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