当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript IDeferred.reject方法代码示例

本文整理汇总了TypeScript中angular.IDeferred.reject方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IDeferred.reject方法的具体用法?TypeScript IDeferred.reject怎么用?TypeScript IDeferred.reject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular.IDeferred的用法示例。


在下文中一共展示了IDeferred.reject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: spyOn

 spyOn(loginService, "attemptLogin").and.callFake(() => {
     const deferred: IDeferred<ILoginError> = $q.defer();
     deferred.reject({data: {
         error: "invalid_something"
     }});
     return deferred.promise;
 });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:7,代码来源:login.controller.spec.ts

示例2:

 ApplicationNameValidator.validate(value, this.cloudProviders).then((result: IApplicationNameValidationResult) => {
   if (result.errors.length) {
     deferred.reject();
   } else {
     deferred.resolve();
   }
 });
开发者ID:mizzy,项目名称:deck,代码行数:7,代码来源:validateApplicationName.directive.ts

示例3: it

    it('should fail when waitUntilExecutionMatches fails', () => {
      const deferred: IDeferred<boolean> = $q.defer();
      let succeeded = false,
          failed = false;

      $http.expectPATCH(requestUrl).respond(200, '');
      spyOn(executionService, 'waitUntilExecutionMatches').and.returnValue(deferred.promise);

      service.provideJudgment(execution, stage, 'continue').then(() => succeeded = true, () => failed = true);

      $http.flush();
      expect(succeeded).toBe(false);
      expect(failed).toBe(false);

      // waitForExecutionMatches...
      deferred.reject();
      $scope.$digest();

      expect(succeeded).toBe(false);
      expect(failed).toBe(true);
    });
开发者ID:robfletcher,项目名称:deck,代码行数:21,代码来源:manualJudgment.service.spec.ts

示例4: spyOn

 spyOn(eventService, "postEvent").and.callFake(() => {
     const deferred: IDeferred<any> = $q.defer();
     deferred.reject();
     return deferred.promise;
 });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:5,代码来源:service-meetings-form.controller.spec.ts

示例5: spyOn

 spyOn(manageInventoryService, "adjustStockLevel").and.callFake(() => {
     const deferred: IDeferred<any> = $q.defer();
     deferred.reject({});
     return deferred.promise;
 });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:5,代码来源:manage-inventory.controller.spec.ts

示例6: spyOn

 spyOn(literatureService, "putCancelOrCompleteLitOrder").and.callFake(() => {
     const deferred: IDeferred<any> = $q.defer();
     deferred.reject({});
     return deferred.promise;
 });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:5,代码来源:manage-orders.controller.spec.ts

示例7: spyOn

 spyOn(pageEditorService, "postPage").and.callFake(() => {
     const deferred: IDeferred<any> = $q.defer();
     deferred.reject();
     return deferred.promise;
 });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:5,代码来源:page-editor-form.controller.spec.ts

示例8: spyOn

 spyOn(confirmModalService, "show").and.callFake(() => {
     const deferred: IDeferred<any> = $q.defer();
     deferred.reject();
     return deferred.promise;
 });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:5,代码来源:page-editor.controller.spec.ts


注:本文中的angular.IDeferred.reject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。