myFlix Angular Client Documentation - v0.0.0
    Preparing search index...

    Component representing the movie card display.

    This component fetches movie data and handles user interactions such as viewing details (genre, director, synopsis), adding/removing favorites, and logging out.

    Implements

    • OnInit
    Index

    Constructors

    • Parameters

      • fetchApiData: FetchApiDataService

        Service for API communication

      • router: Router

        Service for navigation

      • detector: ChangeDetectorRef

        Service to manually trigger change detection

      • dialog: MatDialog

        Service to open Material Dialogs

      • snackBar: MatSnackBar

        Service to display notifications

      Returns MovieCardComponent

    Properties

    dialog: MatDialog

    Service to open Material Dialogs

    fetchApiData: FetchApiDataService

    Service for API communication

    movies: any[] = []

    Array holding all movie data fetched from the API

    router: Router

    Service for navigation

    snackBar: MatSnackBar

    Service to display notifications

    Methods

    • Adds a movie to the user's list of favorites via API. Updates local storage with the new user data.

      Parameters

      • id: string

        The unique ID of the movie

      Returns void

    • Fetches all movies from the backend API. Updates the 'movies' array and triggers change detection.

      Returns void

    • Checks if a movie is in the user's favorite list. This is used in the HTML to determine which icon to show (filled heart vs border).

      Parameters

      • id: string

        The movie ID

      Returns boolean

      boolean - True if the movie is a favorite

    • Lifecycle hook called after component initialization. Fetches the initial list of movies.

      Returns void

    • Opens a dialog showing director details.

      Parameters

      • movie: any

        The movie object containing director information

      Returns void

    • Opens a dialog showing genre details.

      Parameters

      • movie: any

        The movie object containing genre information

      Returns void

    • Opens a dialog showing the movie synopsis.

      Parameters

      • movie: any

        The movie object containing summary information

      Returns void

    • Removes a movie from the user's list of favorites via API.

      Parameters

      • id: string

        The unique ID of the movie

      Returns void