当前位置: 首页>>代码示例>>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;未经允许,请勿转载。