Angular Professional Development Flashcards
7 cards from real Angular Web Framework practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Angular Professional Development flashcards as text
Which Angular CLI command generates a new library inside an existing workspace?
Answer: ng generate library my-lib
The `ng generate library` command scaffolds a publishable Angular library within the current workspace.
What is the primary purpose of Angular's `provideHttpClient()` function introduced in Angular 15+?
Answer: Replace HttpClientModule with a standalone-compatible provider
`provideHttpClient()` is the standalone API equivalent of importing `HttpClientModule`, making it compatible with standalone components.
In Angular's signal-based reactivity (Angular 16+), what does `effect()` do?
Answer: Runs a side-effect function whenever its dependent signals change
`effect()` registers a reactive side-effect that automatically re-runs whenever any signal it reads emits a new value.
Which decorator marks a class as an Angular standalone component without an NgModule?
Answer: @Component({ standalone: true })
Setting `standalone: true` in the `@Component` decorator removes the need to declare the component in any NgModule.
What does Angular's `APP_INITIALIZER` token enable?
Answer: Running async setup tasks before the app fully bootstraps
`APP_INITIALIZER` accepts factory functions that return promises or observables, delaying app bootstrap until they resolve.
Which Angular CDK utility provides accessible focus management for custom overlay components?
Answer: FocusMonitor / FocusTrap
`FocusTrap` and `FocusMonitor` from `@angular/cdk/a11y` manage keyboard focus within overlays to satisfy WCAG requirements.
What is the correct way to enable strict template type checking across an Angular project?
Answer: Set `"strictTemplates": true` in angular.json under `architect > build`
Strict template type checking is enabled by setting `"strictTemplates": true` inside the `angularCompilerOptions` section of `tsconfig.json`.