Adding missing race method to angular.IQService (#18476)

* Adding missing race method to angular.IQService

https://docs.angularjs.org/api/ng/service/$q lists race(promises); as a valid method in AngularJS $q. Adding this type so it can be used accordingly.

* Fixing lint errors

* Fixing use of array
This commit is contained in:
Joel Poloney
2017-07-28 12:47:05 -07:00
committed by Andy
parent 70c6450707
commit a7bc5ed2d4

View File

@@ -1035,6 +1035,12 @@ declare namespace angular {
* Creates a Deferred object which represents a task which will finish in the future.
*/
defer<T>(): IDeferred<T>;
/**
* Returns a promise that resolves or rejects as soon as one of those promises resolves or rejects, with the value or reason from that promise.
*
* @param promises A list or hash of promises.
*/
race<T>(promises: Array<IPromise<T>> | {[key: string]: IPromise<T>}): IPromise<T>;
/**
* Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.
*