what is the right way to pass headers to http get request. I am using ionic 3 framework and getting this error "Expected 0 type arguments, but got 1". My function returns an observable of type IMessage.
import { Http, Headers, RequestOptions } from '@angular/http';
getChats(token:string):Observable<IMessage[]>{
let headers = new Headers({
'Content-Type' : 'application/json',
'Authorization': 'Bearer'+ token
});
let options = new RequestOptions({ headers: headers });
return this.http.get<IMessage[]>(this.url, options);
}
Note that when I return an observable of type any the request succeed.