Res.json not a function

helo i have this error and am wondering why the code isnt working

this.http.get(‘http://slickstars.com/api/traffic_updates’)
.map((res: Response) => res.json()).subscribe(data => {
this.posts = data.data;
});

they tell me res.json is not a function

Hello @wandie !

Follow code:

this.http.get('http://slickstars.com/api/traffic_updates')
    .map(res => res.json())
    .subscribe(data => {
      this.posts = data;
      console.log(this.posts);
    });

Thanks! :+1:

thanks let me give it a shot