I have this method in angular js. I had to update success to then because of change in version but now I get the mentioned error. I am using typings 6.5.6 taken from nuget, and typescript version 2.6 according to the project properties in Visual Studio.
This is my method. The error is in the 'then' part. It doesn't like the data being type string.
I have looked at IHttpPromise incorrectly extends IPromise with TypeScript 2.5 But IHttpPromise and IHttpResponse are not available to me, so are my typings version the issue?
EmailQuote(quoteRef: string, password: string,testAddress:string,putintTAM:boolean): ng.IPromise<string> {
var defer = this.q.defer<string>();
this.rootScope.loading = true;
this.http({
url: "api/quoteEngine/emailQuote?quoteRef=" + quoteRef + "&password=" + password + "&testAddress=" + testAddress + "&putinTam=" + putintTAM,
method: "POST"
})
.then((data: string) => {
this.rootScope.loading = false;
defer.resolve(data);
})
.catch((reason: any) => {
this.rootScope.loading = false;
this.ShowError(reason.data.message);
defer.reject(reason.data);
});
return defer.promise;
}