Integrating the shared logic
Without a doubt, we want to reuse as much code as possible in our new and awesome Angular application! The good news is that we can, and, as you'll see, it is really straightforward. It wouldn't be the case for just any project, but the fact is that our code is already written in TypeScript, uses modules, and is pretty well-structured.
We will now create an Angular module called shared. We will use it to store elements that can be reused across the application. In this shared module, we will store our generic domain model classes, services, and more. Obviously, this module will contain everything about Media.
Open up a Terminal and go to the application's src/app folder. Then, create the new module using the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access