當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。