ERROR in src/app/new-applicant/new-applicant.service.ts(35,65): error TS2345: Argument of type '{ reportProgress: boolean; observe: string; headers: HttpHeaders; }' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }'. Types of property 'observe' are incompatible. Type 'string' is not assignable to type '"body"'.
public generateHeaders()
{
let access=JSON.parse(sessionStorage.getItem("meta_info")).access
// access=access.access;
console.log(access)
var headers_object = new HttpHeaders().set("Authorization", "Bearer " + access);
const httpOptions = {
reportProgress:true,
observe:'events',
headers: headers_object
};
return httpOptions
}
service
public registerNewApplicant(data)
{
return this.http.post(environment.baseURL+"applicant/",data,this.jwtTokenGenerator.generateHeaders())
}