my-flix-angular-client
    Preparing search index...

    Movies page that lists all movies and lets the user view details (genre, director, synopsis) and toggle favorites.

    Implements

    • OnInit
    Index

    Constructors

    • Parameters

      • fetchApiData: FetchApiData

        API service for movie/user endpoints.

      • dialog: MatDialog

        Material dialog service for info dialogs.

      • snackBar: MatSnackBar

        Snackbar for user feedback.

      • router: Router

        Router for auth redirects and logout.

      Returns MovieCard

    Properties

    favoriteIds: Set<string> = ...

    Set of favorited movie IDs for quick checks.

    fetchApiData: FetchApiData

    API service for movie/user endpoints.

    movies: any[] = []

    Full list of movies for display.

    username: string = ''

    Username of the currently logged in user (from localStorage).

    Methods

    • Replace broken poster images with a placeholder.

      Parameters

      • event: any

        Browser image error event.

      Returns void

    • Check if a movie ID is currently favorited.

      Parameters

      • movieId: string

        Movie ObjectId.

      Returns boolean

    • Initialize the page:

      • Redirect to welcome if unauthenticated
      • Load favorites and fetch movies

      Returns void

    • Open the Director details dialog for a movie.

      Parameters

      • movie: any

      Returns void

    • Open the Genre details dialog for a movie.

      Parameters

      • movie: any

      Returns void

    • Toggle favorite state for a given movie.

      Parameters

      • movie: any

        Movie object from the list.

      Returns void