mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Merge pull request #6049 from marcogrcr/add-qservice-when-method
Added resolve method to angular.IQService.
This commit is contained in:
commit
bd1a814ded
@ -296,6 +296,17 @@ module TestQ {
|
||||
result = $q.reject('');
|
||||
}
|
||||
|
||||
// $q.resolve
|
||||
{
|
||||
let result: angular.IPromise<void>;
|
||||
result = $q.resolve();
|
||||
}
|
||||
{
|
||||
let result: angular.IPromise<TResult>;
|
||||
result = $q.resolve<TResult>(tResult);
|
||||
result = $q.resolve<TResult>(promiseTResult);
|
||||
}
|
||||
|
||||
// $q.when
|
||||
{
|
||||
let result: angular.IPromise<void>;
|
||||
|
||||
10
angularjs/angular.d.ts
vendored
10
angularjs/angular.d.ts
vendored
@ -1055,12 +1055,20 @@ declare module angular {
|
||||
*
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
when<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
resolve<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*/
|
||||
resolve(): IPromise<void>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
when<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*/
|
||||
when(): IPromise<void>;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user