本文整理匯總了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;
});
示例2:
ApplicationNameValidator.validate(value, this.cloudProviders).then((result: IApplicationNameValidationResult) => {
if (result.errors.length) {
deferred.reject();
} else {
deferred.resolve();
}
});
示例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);
});
示例4: spyOn
spyOn(eventService, "postEvent").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.reject();
return deferred.promise;
});
示例5: spyOn
spyOn(manageInventoryService, "adjustStockLevel").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.reject({});
return deferred.promise;
});
示例6: spyOn
spyOn(literatureService, "putCancelOrCompleteLitOrder").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.reject({});
return deferred.promise;
});
示例7: spyOn
spyOn(pageEditorService, "postPage").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.reject();
return deferred.promise;
});
示例8: spyOn
spyOn(confirmModalService, "show").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.reject();
return deferred.promise;
});