← All Angular Web Framework Flashcard Decks

Mixed Deck — All Angular Web Framework Topics Flashcards

100 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 20 Mixed Deck — All Angular Web Framework Topics flashcards as text
  1. In Angular, what is the purpose of `ng-content` with a `select` attribute?

    Answer: To project only matching elements from the parent

    The `select` attribute on ng-content acts as a CSS selector to filter which projected content goes into that slot.

  2. What is the impact of regulatory changes on Angular professionals?

    Answer: Regulatory changes require updating practices, procedures, and documentation to maintain compliance

    Professionals must monitor and adapt to regulatory changes that affect their practice, ensuring continued compliance and effective service delivery.

  3. What does the RouterModule.forChild() method do compared to RouterModule.forRoot()?

    Answer: It registers routes without creating a new Router service instance

    forChild() registers additional routes while reusing the single Router service instance created by forRoot().

  4. What is the importance of peer review in angular development?

    Answer: Peer review ensures quality, catches errors, provides learning opportunities, and maintains professional standards

    Peer review is a cornerstone of professional quality assurance, providing independent verification, knowledge sharing, and continuous improvement opportunities.

  5. What distinguishes a `cold` Observable from a `hot` Observable in RxJS?

    Answer: Cold Observables start producing values upon each subscription; hot Observables share a single execution

    Each subscriber to a cold Observable triggers an independent data producer, while hot Observables multicast from a shared source regardless of subscribers.

  6. What is the purpose of the `takeUntil` operator in Angular component lifecycle management?

    Answer: Completes the Observable when a notifier Observable emits

    takeUntil is commonly used with a destroy$ Subject to automatically unsubscribe when a component is destroyed.

  7. What does the `host` property in a @Component decorator allow you to configure?

    Answer: Host element bindings and listeners

    The `host` property maps DOM events and property bindings directly onto the component's host element.

  8. In an Angular lazy-loaded route configuration, what does the loadChildren property accept in modern Angular (v9+)?

    Answer: A dynamic import() returning a module with routing

    Modern Angular uses dynamic import() syntax like () => import('./feature/feature.module').then(m => m.FeatureModule) for lazy loading.

  9. What does the `async` pipe do when it receives a new Observable or Promise?

    Answer: Unsubscribes from the old Observable and subscribes to the new one automatically

    When the bound reference changes, the async pipe unsubscribes from the previous stream and subscribes to the new one, always displaying the latest emitted value.

  10. What is a standalone component in Angular?

    Answer: A component that declares its own dependencies without an NgModule

    Standalone components use `standalone: true` and list their own imports, removing the requirement to be declared in an NgModule.

  11. How do you cancel an in-flight HTTP request in Angular?

    Answer: Unsubscribe from the Observable returned by HttpClient

    Unsubscribing from the HttpClient Observable triggers teardown logic that aborts the underlying XHR request.

  12. Which Angular animation state transition syntax triggers an animation whenever an element enters the DOM?

    Answer: Both ':enter' and 'void => *' are equivalent

    `:enter` is an alias for `void => *`, both representing the state transition when an element is inserted into the DOM.

  13. What happens when HttpClient.get() is called but its returned Observable is never subscribed to?

    Answer: No HTTP request is sent because observables are cold and lazy

    HttpClient observables are cold — no HTTP request is made until something actively subscribes to the observable.

  14. What is the role of the Angular CLI's esbuild-based builder introduced in Angular 17?

    Answer: Provides significantly faster build and rebuild times replacing Webpack

    Angular 17's application builder uses esbuild for up to 72% faster production builds and near-instant incremental rebuilds during development.

  15. What are lazy loaded modules?

    Answer: Feature modules loaded on demand when their route is first accessed, reducing initial bundle size

    Lazy loading defers loading of feature modules until the user navigates to their routes, reducing the initial application bundle size and improving startup performance.

  16. What is a service in Angular?

    Answer: A class with a focused purpose that provides shared functionality across components

    Angular services are TypeScript classes decorated with @Injectable() that encapsulate reusable business logic, data access, or utility functions that can be shared across multiple components.

  17. How would you display a View using a router outlet?

    Answer: Nothing. The view will display in the tag

    The correct answer: Nothing. The view will display in the tag

  18. In a lazy-loaded module, where is a service provided if it is listed in that module's `providers` array?

    Answer: A child injector created specifically for that lazy module

    Lazy-loaded modules get their own child injector, so services provided there are isolated to that module and not shared with the rest of the application.

  19. Which Jasmine function is used to set up shared initialization code that runs before each test in a describe block?

    Answer: beforeEach()

    beforeEach() runs its callback before every it() block in its enclosing describe, making it ideal for resetting state between tests.

  20. What does enabling `ivy` (the default since Angular 9) improve compared to the legacy View Engine?

    Answer: Smaller bundles, faster compilation, and better tree-shaking through locality principle

    Ivy compiles each component independently (locality), enabling better tree-shaking, smaller bundles, and faster incremental rebuilds.