Alex Eagle e5c3695dbd Revert "refactor: use new Http library in playground (#29355)"
This reverts commit acfcf90528de431575fba336df0e06c1ebc6c734.
2019-04-26 16:49:50 -07:00

29 lines
660 B
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Component} from '@angular/core';
import {Jsonp} from '@angular/http';
@Component({
selector: 'jsonp-app',
template: `
<h1>people</h1>
<ul class="people">
<li *ngFor="let person of people">
hello, {{person['name']}}
</li>
</ul>
`
})
export class JsonpCmp {
people: Object;
constructor(jsonp: Jsonp) {
jsonp.get('./people.json?callback=JSONP_CALLBACK').subscribe(res => this.people = res.json());
}
}