File

src/app/components/movie/movie.component.ts

Description

Generates a movie component, generated from the provided MovieData parameter.
Movie component consists of a poster and a title, which are presented in
the homepage lists.

Metadata

selector app-movie
styleUrls movie.component.css
templateUrl movie.component.html

Inputs

movie

Constructor

constructor(reviewService: any)

Properties

MovieData
MovieData: any
ReviewAverage
ReviewAverage: any
reviewStats
reviewStats: boolean
import { Component, Input, OnInit } from '@angular/core';
import { ReviewService } from 'src/app/services/review-service/review.service';
import { MovieData } from 'src/lib/types/MovieData';
import { ReviewAverage } from 'src/lib/types/Review';
/**
 * Generates a movie component, generated from the provided MovieData parameter.
 * Movie component consists of a poster and a title, which are presented in
 * the homepage lists.
 */
@Component({
  selector: 'app-movie',
  templateUrl: './movie.component.html',
  styleUrls: ['./movie.component.css']
})
export class MovieComponent implements OnInit {
  @Input() movie !: MovieData;
  reviewStats !: ReviewAverage

  constructor(private reviewService: ReviewService) { }

  async ngOnInit() {
    this.reviewStats = await this.reviewService.getReviewStats(this.movie.id)
  }
}

results matching ""

    No results matching ""