NetanelBasal
7/4/2018 - 3:54 PM

movies.component.ts

@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();
  }
}