Instead, you can try the following:
this.videoData = this.jsonp .get('localhost:8080/video/newst/' + count + '?jsonp=JSONP_CALLBACK') .map(res => <Video[]>res.json();
Edit
I think your request does not return JSONP content, but classic (JSON). If so, you can try the following:
import { bootstrap } from 'angular2/platform/browser'; import { Component } from 'angular2/core'; import { HTTP_PROVIDERS, Http } from 'angular2/http'; import "rxjs/add/operator/map"; @Component({ selector: "app", templateUrl: "app.html", providers: [HTTP_PROVIDERS] }) class App { private feedData: Observable<Video[]>; constructor(private http: Http) { } ngOnInit() { this.displayNewstVideo(10); } private displayNewstVideo(count: number) { this.videoData = this.http .get('localhost:8080/video/newst/' + count) .map(res => (res.json() as Video[])) .do(videoData => { console.log(videoData); }); } } bootstrap(App);
source share