Angular components, modules, services, dependency injection, templates, directives, RxJS observables, routing and signals.
35 cards · basic cards · AI-written, checked twice. Edit anything.
- What is an Angular component?
Show answer
A reusable building block combining a template, class, and metadata decorator
- What decorator marks a class as an Angular component?
Show answer
@Component
- In @Component, what property specifies the HTML template?
Show answer
templateUrl or template
- In @Component, what property specifies CSS styles?
Show answer
styleUrls or styles
- What is component lifecycle in Angular?
Show answer
A series of hooks called at key moments like init, change detection, and destroy
- What is an Angular module?
Show answer
A container for components, services, directives, and pipes grouped by functionality
- What decorator marks a class as an Angular module?
Show answer
@NgModule
- Name the four main properties of @NgModule
Show answer
declarations, imports, exports, providers
- What is an Angular service?
Show answer
A class providing functionality or data that can be shared across multiple components
- What decorator marks a class as a service?
Show answer
@Injectable
- What does the providedIn property in @Injectable specify?
Show answer
Where the service should be registered (e.g., root, a specific module)
- Why use services in Angular?
Show answer
To share logic and data across components and follow single-responsibility principle
- What is dependency injection?
Show answer
A design pattern where a class receives its dependencies from external sources
- How do you inject a service into a component?
Show answer
Add it as a constructor parameter with the appropriate type
- What is the purpose of the Injector in Angular?
Show answer
To create instances of services and automatically resolve their dependencies