Angular Architecture
One of the major design considerations in angular is to reduce the size of the final bundle, with this, some of the libraries that are required for angular app to work are provided through core libraries, and other optional libraries can be imported as per needs.
Components are the basic building blocks of angular applications, this uses other dependencies like services, directives etc to perform its task.
Below architecture diagram can give a better idea on how each parts interact each other.
Modules
Angular Modules contains different parts of the application and are the way to group related component, services, directives and pipes to a single unit.
Component
Major development in angular is done using component. Each component is linked to view. It can be viewed as a reusable component as well.
Components are part of ngModules and each component can use other components as well. It can be viewed as a tree structure.
Template represents the html view and it communicates with the component through property and events.
Services are nothing but reusable functions that are separated from components but can be injected through dependency injection. This is very useful when you want to use same methods or properties in multiple places.
Components are part of ngModules and each component can use other components as well. It can be viewed as a tree structure.
Template represents the html view and it communicates with the component through property and events.
Services are nothing but reusable functions that are separated from components but can be injected through dependency injection. This is very useful when you want to use same methods or properties in multiple places.
Routing
When it come to Single Page Application(SPA), we often hear angular associated with it. Angular is designed to mainly with the objective of SPA. Angular router framework evolved over the years and become a well matured framework to support all needs of SPA.
Routing works based on the URL structure. It allows us to define the routes and its corresponding components using a Route array. When the URL matches the defined route, its component get loaded in to main template.