angularjs: changed $q.all() (added a type variable and tests)

This commit is contained in:
Ilya Mochalov committed 2015-08-07 23:36:27 +05:00
1 parent a95ee80de0
commit fcc892bba5
2 files changed
+14 -1

No files matched your search

+2 -1
View File
@@ -1006,7 +1006,7 @@ declare module angular {
*
* @param promises An array of promises.
*/
all(promises: IPromise<any>[]): IPromise<any[]>;
all<T>(promises: IPromise<any>[]): IPromise<T[]>;
/**
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
*
@@ -1015,6 +1015,7 @@ declare module angular {
* @param promises A hash of promises.
*/
all(promises: { [id: string]: IPromise<any>; }): IPromise<{ [id: string]: any; }>;
all<T extends {}>(promises: { [id: string]: IPromise<any>; }): IPromise<T>;
/**
* Creates a Deferred object which represents a task which will finish in the future.
*/