mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user