We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebd15a7 commit 860e88cCopy full SHA for 860e88c
modules/playground/src/http/http_comp.ts
@@ -1,5 +1,5 @@
1
import {Component, View, NgFor} from 'angular2/angular2';
2
-import {Http} from 'angular2/http';
+import {Http, Response} from 'angular2/http';
3
4
@Component({selector: 'http-app'})
5
@View({
@@ -14,8 +14,10 @@ import {Http} from 'angular2/http';
14
`
15
})
16
export class HttpCmp {
17
- people: Object;
+ people: Object[];
18
constructor(http: Http) {
19
- http.get('./people.json').map(res => res.json()).subscribe(res => this.people = res);
+ http.get('./people.json')
20
+ .map((res: Response) => res.json())
21
+ .subscribe((people: Array<Object>) => this.people = people);
22
}
23
0 commit comments