Last active
March 3, 2019 20:31
-
-
Save brandonroberts/ff8d1f4381168d28f72deaa719d0b618 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: 'app-movies-page', | |
template: ` | |
<h1>Movies Page</h1> | |
<div *ngIf="error"> | |
{{ error }} | |
</div> | |
` | |
}) | |
export class MoviesPageComponent implements OnInit { | |
error = ''; | |
constructor( | |
private store: Store<fromRoot.State>, | |
actions$: Actions | |
) { | |
actions$.pipe( | |
ofType('[Movies/API] Load Movies Failure'), | |
).subscribe(action => this.error = action.payload); | |
} | |
ngOnInit() { | |
this.store.dispatch({ type: '[Movies Page] Load Movies' }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment