Currently, I am in the process of transitioning a project from Angular2 beta1 to Angular2 beta15, and encountering some obstacles.
An error message that I'm encountering is: 'map' property does not exist on 'Observable< Response >'
Below is an example of code snippet where this error occurs:
import { Injectable } from 'angular2/core';
import { Http, Response, Headers } from 'angular2/http';
import { Observable } from 'rxjs/Observable';
import { HelperModule } from './helpers.module';
import { BlogPost } from './model';
import 'rxjs/add/operator/map';
/**
* Service handling blog data
*/
@Injectable()
export class DataService {
constructor(private http: Http) { }
/**
* Call API to retrieve list of available blog posts
*/
listBlogPosts() {
return this.http.get(HelperModule.UrlBuilder.BuildPostListUrl()).map(res => (<Response>res).json());
}
}
You can access the complete code here : https://github.com/AdrienTorris/AspNet5Angular2Playground
UPDATE : Currently using rxjs 5.0.0-beta6 and typescript 1.8.10, with target set to es6