What are the main parts of an Angular application?
An Angular application consists of several key parts:
Key parts
- Modules - containers for related components, directives, services, and other modules. The application's root module is usually called
AppModule. - Components - manage a part of the user interface. They consist of a template (HTML), styles (CSS/SCSS), and a class (TypeScript).
- Templates - HTML code with Angular syntax for binding data and events to the component.
- Directives - change the behavior or appearance of DOM elements. Divided into structural (
*ngIf,*ngFor) and attribute (ngClass,ngStyle) directives. - Services - provide business logic or shared functionality for components, typically used with Dependency Injection.
- Pipes - transform data in templates, for example formatting a date or a number.
- Routing - navigation between components, managed through
RouterModule. - Angular modules and libraries - built-in tools and third-party libraries that extend the application's functionality.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.