We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5514dc1 commit f76eea4Copy full SHA for f76eea4
modules/playground/src/http/http_comp.ts
@@ -1,5 +1,6 @@
1
import {Component, View, NgFor} from 'angular2/angular2';
2
import {Http, Response} from 'angular2/http';
3
+import 'rxjs/operators/map';
4
5
@Component({selector: 'http-app'})
6
@View({
@@ -16,6 +17,8 @@ import {Http, Response} from 'angular2/http';
16
17
export class HttpCmp {
18
people: Object[];
19
constructor(http: Http) {
- http.get('./people.json').subscribe(res => { this.people = res.json(); });
20
+ http.get('./people.json')
21
+ .map((res: Response) => res.json())
22
+ .subscribe((people: Array<Object>) => this.people = people);
23
}
24
0 commit comments