Reputation: 7299
I use a variable
private $http:ng.IHttpService;
then i use a get call
this.$http({
url: url
skipAuthorization: true,
method: 'GET',
params:dataToBeSent
})
The skipAuthorization flag is a flag used by angular-jwt, which causes it not to send the jwt.
I get the TypeScript error:
Error TS2345: Argument of type '{ url: string; skipAuthorization: boolean; method: string; params: { ..' is not assignable to parameter of type 'IRequestConfig'. Object literal may only specify known properties, and 'skipAuthorization' does not exist in type 'IRequestConfig'.
How can I fix this error?
Upvotes: 0
Views: 221
Reputation: 28646
This makes my TypeScript compiler happy:
let conf = {
url: url,
skipAuthorization: true,
method: 'GET',
params:dataToBeSent
} as IRequestConfig;
this.$http(conf);
Upvotes: 3