Skip to main content

What are the main parts of an Angular application?

An Angular application consists of several key parts:

Key parts

  1. Modules - containers for related components, directives, services, and other modules. The application's root module is usually called AppModule.
  2. Components - manage a part of the user interface. They consist of a template (HTML), styles (CSS/SCSS), and a class (TypeScript).
  3. Templates - HTML code with Angular syntax for binding data and events to the component.
  4. Directives - change the behavior or appearance of DOM elements. Divided into structural (*ngIf, *ngFor) and attribute (ngClass, ngStyle) directives.
  5. Services - provide business logic or shared functionality for components, typically used with Dependency Injection.
  6. Pipes - transform data in templates, for example formatting a date or a number.
  7. Routing - navigation between components, managed through RouterModule.
  8. Angular modules and libraries - built-in tools and third-party libraries that extend the application's functionality.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.