What's the difference between a component and a module.

I've been watching videos and reading articles but this particular one made me confused at the beginning.

The modular structure is followed by the applications.Each module will be dedicated to the single purpose.A module is a cohesive group of code which is integrated with the other modules.

Some classes, function and values are exported from a module.Multiple components will make up your application because the Component is a fundamental block.

A module can be used for another module.The primary Angular library module will be imported by another component.

The components control views.They communicate with other components and services.

Modules have one or more components.They don't control anything.The components that can be used by components belonging to other modules are declared by your modules.You can bring modularity to your app with modules.

It's too late to post an answer, but I think my explanation will be easy to understand for beginners.I give examples during my presentation.

Think of your application as a building.A building can have many apartments.An apartment is a module.An apartment can have a number of rooms that correspond to the building blocks of an application.

Each apartment will have rooms, lifts, and wires that can be used to transform around and make it useful in the apartments.

A swimming pool, tennis court, and other places will be shared by all building residents.These components can be considered as part of SharedModule.

Component, Service, Pipe is a small container that is part of the module.

Rewriting of code isn't required because the code is a reuse that is shared by the components.

One of the basic building blocks of an app is a component.An app can have more than one component.In a normal app, a component contains a class file that controls the behavior of theHTML page and theCSS/scss file to style it.The component can be created with the help of the component decorator.

A module is a set of basic building blocks.An app can have more than one module.

A module is made from components, directives, services and more.An Application can be made by one or many modules.Modules break application into logical pieces of code.A single task is performed by each module.

The logic for the page you want to display is written in the components.The view is controlled by components.Other components and services communicate with components.

The component is a template and a class containing some logic for the view and some information about where to find the data.

Related Posts:

  1. Can you have an elliptical in an apartment?
  2. What is logic used for?
  3. How to block channels on smart TVs with step-by- step instructions.
  4. What is Apartment List com?