I've been watching videos and reading articles but this specific article make me so confused, at the start of the article it says
The applications in Angular follow modular structure. The Angular apps will contain many modules, each dedicated to the single purpose. Typically module is a cohesive group of code which is integrated with the other modules to run your Angular apps.
A module exports some classes, function and values from its code. The Component is a fundamental block of Angular and multiple components will make up your application.
A module can be a library for another module. For instance, the angular2/core library which is a primary Angular library module will be imported by another component.
Are they exchangeable terms? Is a component a module? But not viceversa?
Components are put together (synthesis) to build a software. Modules are the result of dividing (analysis) the code. So components are about the high-level design of a software, whereas modules are more about organization on the code level.
Module in Angular refers to a place where you can group the components, directives, pipes, and services, which are related to the application. In case you are developing a website, the header, footer, left, center and the right section become part of a module. To define module, we can use the NgModule.
Every component in our app needs to be declared inside an Angular module for us to use it. We have also imported BrowserModule. The browser module is actually the ng module for our browser, as per Angular's official documentation.
A module is a collection of components, services, pipes, directives, and so on. A component in Angular is a building block of the application with an associated template view. The angular apps will contain many modules, each dedicated to a single purpose.
Components control views (html). They also communicate with other components and services to bring functionality to your app.
Modules consist of one or more components. They do not control any html. Your modules declare which components can be used by components belonging to other modules, which classes will be injected by the dependency injector and which component gets bootstrapped. Modules allow you to manage your components to bring modularity to your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With