Skip to content

Instantly share code, notes, and snippets.

@brandonroberts
Last active March 3, 2019 20:30
Show Gist options
  • Save brandonroberts/17ee8dbdf8a2ae11cd0e5b74c5a3be0e to your computer and use it in GitHub Desktop.
Save brandonroberts/17ee8dbdf8a2ae11cd0e5b74c5a3be0e to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-movies-page',
template: `
<h1>Movies Page</h1>
<div *ngIf="error$ | async as errorMessage">
{{ errorMessage }}
</div>
`
})
export class MoviesPageComponent implements OnInit {
error$ = this.store.select(fromRoot.selectMoviesPageError);
constructor(private store: Store<fromRoot.State>) {}
ngOnInit() {
this.store.dispatch('[Movies Page] Load Movies');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment