本文整理汇总了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;
});