getEmployeeList():Observable<Employee[]>{
return this.http.get<Employee[]>('moi/employee/getEmp', AuthService.getHttpOptions());
}
and my AuthService.getHttpOptions()
method is:
public static getHttpOptions(): any {''
var httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'observe': "body",
'Authorization': "Bearer " + localStorage.getItem("authtoken")
})
};
return httpOptions;
}
Got the error:
Type 'Observable<HttpEvent<Employee[]>>' is not assignable to type 'Observable<Employee[]>'.
Type 'HttpEvent<Employee[]>' is not assignable to type 'Employee[]'.
Type 'HttpSentEvent' is not assignable to type 'Employee[]'.
Property 'includes' is missing in type 'HttpSentEvent'.