Changed order of IHttpPromise.then for promise chaining

previously the following code resulted in tmp beeing of type:
ng.IPromise<ng.IPromise<{}>> but it should be just ng.IPromise<{}>:

var tmp = this.$http.get('').then((result) => this.$q.defer().promise);
This commit is contained in:
Herbert Poul
2014-07-02 18:17:13 +02:00
parent 87fba9fea2
commit e839251ce9
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -220,6 +220,17 @@ foo.then((x) => {
});
var httpFoo: ng.IHttpPromise<number>;
httpFoo.then((x) => {
// When returning a promise the generic type must be inferred.
var innerPromise : ng.IPromise<number>;
return innerPromise;
}).then((x) => {
// must still be number.
x.toFixed();
});
// angular.element() tests
var element = angular.element("div.myApp");
var scope: ng.IScope = element.scope();