Skip to content

Instantly share code, notes, and snippets.

@alxhub
Created March 26, 2016 15:55
Show Gist options
  • Save alxhub/6c7c95419c3bbf1dca9d to your computer and use it in GitHub Desktop.
Save alxhub/6c7c95419c3bbf1dca9d to your computer and use it in GitHub Desktop.
@Component({
selector: 'view-post',
template: `
<comment-list *ngIf="post | async" [postId]="(post | async)?.id"></comment-list>
`
})
export class ViewPost {
post: Observable<IPost>
constructor() {
this.post = this
.functionThatReturnsAnObservable
.map(data => data.json());
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment