@Component({
selector: 'app-movies',
templateUrl: './movies.component.html',
styleUrls: ['./movies.component.css']
})
export class MoviesComponent implements OnInit {
movies$: Observable<Movie[]>;
isLoading$: Observable<boolean>;
constructor(private moviesQuery: MoviesQuery,
private moviesService: MoviesService) {}
ngOnInit() {
this.isLoading$ = this.moviesQuery.selectLoading();
this.movies$ = this.moviesQuery.selectMovies();
this.moviesService.getMovies();
}
}