I have setup my application with HTTP_PROVIDERS
bootstrap(AppComponent, [
HTTP_PROVIDERS,
ROUTER_PROVIDERS,
provide(LocationStrategy, { useClass: HashLocationStrategy }),
PostService
]);
and my service like
@Injectable()
export class PostService {
posts = [];
constructor(http: Http) {
this.http = http;
}
}
but when i call
this.http.get('/posts')
It returns an Observable
which has no map
method, it drives me crazy for hours. Im using Babel to transpile my javascript code.