angularjs: fix typings for $q.all(array)

This commit is contained in:
thorn0
2016-03-15 02:54:37 +02:00
parent 0cd5f0a148
commit 18c25bcac5
2 changed files with 13 additions and 1 deletions
+3
View File
@@ -272,6 +272,9 @@ module TestQ {
{
let result: angular.IPromise<any[]>;
result = $q.all([promiseAny, promiseAny]);
// TS should infer that n1 and n2 are numbers and have toFixed.
$q.all([1, $q.when(2)]).then(([ n1, n2 ]) => n1.toFixed() + n2.toFixed());
$q.all([1, $q.when(2), '3']).then(([ n1, n2, n3 ]) => n1.toFixed() + n2.toFixed() + n3.slice(1));
}
{
let result: angular.IPromise<TResult[]>;