@Component({
selector: 'my-app',
template: `
<div>
<p>{{ (person | async)?.id }}</p>
<p>{{ (person | async)?.title }}</p>
<p>{{ (person | async)?.body }}</p>
</div>
`,
})
export class App {
constructor(public http: Http) {
this.person = this.http.get('https://jsonplaceholder.typicode.com/posts/1')
.map(res => res.json())
}
}