Created
March 26, 2016 15:55
-
-
Save alxhub/6c7c95419c3bbf1dca9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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