Angular Modules
Explore Angular modules to understand how they organize applications by grouping components, directives, and pipes. Learn the differences from JavaScript modules, the purpose of key NgModule arrays, and how feature and shared modules improve application structure. Gain the skills to create and import modules using the Angular CLI.
With the development setup ready, we are now ready to learn about all the basic building blocks that make up an Angular application, these include components, modules, services, and pipes, etc.
The first important step in this process is to understand what Angular Modules are.
Frequently asked questions
These are some frequently asked questions by most beginners.
Q. Are Angular modules a kind of container?
Q. Are Angular modules the same as JavaScript modules?
Q. Is an Angular module a block of code with some business logic?
This lesson will cover these questions.
Angular modules
Angular modules are a key part of any Angular application.
If you look at the image above, you will understand how your application structure would look like when you leverage modules in Angular.
It makes the application more logical and structured with all your functionality defined module wise.
You can think of a module as a class that is decorated with @NgModule. This helps us organize the various pieces inside our application and interact with third-party libraries by integrating them.
It also allows us to import and export the sub pieces to other modules.
The @NgModule decorator holds the metadata for the ...