We are almost there! The last thing that we need to do is to instantiate our different classes.
Add the following code at the end of mediaman.ts.
First, create an instance of the view:
const view: HTMLMediaManView = new HTMLMediaManView();
Then instantiate the services:
const bookService = new MediaServiceImpl<Book>(Book); console.log("Book service initialized: ", bookService); const movieService = new MediaServiceImpl<Movie>(Movie); console.log("Movie service initialized: ", movieService);
Now we can finally instantiate our controller and provided it with the view and service instances:
const mediaManController = new MediaManControllerImpl(view, bookService, movieService);
Finally, because of the way our code is bundled and loaded in the browser using Parcel.js (https://parceljs.org), we need to add a global...