diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 6b79b93cc..11f1e327b 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -242,6 +242,18 @@ foo.then((x) => { x.toFixed(); }); +// $q signature tests +module TestQ { + var $q: ng.IQService; + var promise1: ng.IPromise; + var promise2: ng.IPromise; + + // $q.all + $q.all([promise1, promise2]).then((results: any[]) => {}); + $q.all([promise1, promise2]).then((results: number[]) => {}); + $q.all({a: promise1, b: promise2}).then((results: {[id: string]: any;}) => {}); + $q.all<{a: number; b: string;}>({a: promise1, b: promise2}).then((results: {a: number; b: string;}) => {}); +} var httpFoo: ng.IHttpPromise; httpFoo.then((x) => { diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 73629204a..17c0c9384 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1006,7 +1006,7 @@ declare module angular { * * @param promises An array of promises. */ - all(promises: IPromise[]): IPromise; + all(promises: IPromise[]): IPromise; /** * 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; }): IPromise<{ [id: string]: any; }>; + all(promises: { [id: string]: IPromise; }): IPromise; /** * Creates a Deferred object which represents a task which will finish in the future. */