typescript - Migration from Angular2 beta1 to Angular2 beta15 - .map() error -
i'm trying migrate project angular2 beta1 angular2 beta15 , have issues.
i have error message : 'map' property not exists on 'observable< response >'
example of code error :
import { injectable } 'angular2/core'; import { http, response, headers } 'angular2/http'; import { observable } 'rxjs/observable'; import { helpermodule } './helpers.module'; import { blogpost } './model'; import 'rxjs/add/operator/map'; /** * service dealing blog data */ @injectable() export class dataservice { constructor(private http: http) { } /** * call api list available blog posts */ listblogposts() { return this.http.get(helpermodule.urlbuilder.buildpostlisturl()).map(res => (<response>res).json()); } }
code available here : https://github.com/adrientorris/aspnet5angular2playground
edit : i'm using rxjs 5.0.0-beta6 , typescript 1.8.10, targetting es6
try using latest version of typescript (1.9) compile code. module augmentation bugged in minor versions of ts 1.8. rxjs changed way defines modules after 5.0.0-beta2.
you can try nightly build using: npm install -g typescript@next
Comments
Post a Comment