In what scenario would you use the ResolveEnd Router Event?

  • For capturing the start of navigation
  • For handling navigation errors
  • For intercepting route changes
  • For triggering preloading strategies
The ResolveEnd Router Event is used for intercepting route changes and executing code when a route is resolved.

What is the primary advantage of using the async pipe in Angular templates?

  • Automatically unsubscribes
  • Efficiently manage memory resources
  • Enables two-way data binding
  • Simplifies handling HTTP requests
The primary advantage of using the async pipe is that it automatically unsubscribes from the Observable when the component is destroyed, preventing memory leaks.

Why is it necessary to test Angular pipes?

  • To check component logic
  • To ensure pipe transformations
  • To validate routing
  • To verify module imports
Testing Angular pipes is necessary to ensure pipe transformations are working correctly and producing the expected output in templates.

In which of the following situations would you use an @Input() decorator in a component?

  • To define local variables
  • To emit custom events from the component
  • To inject services into the component
  • To pass data from a parent component
The @Input() decorator is used when you need to pass data from a parent component to a child component, allowing the child to receive input data.

How can you protect child routes with a Route Guard in Angular?

  • By using 'canActivate' Route Guard
  • By using 'canActivateChild' Route Guard
  • By using 'canDeactivate' Route Guard
  • By using 'canLoad' Route Guard
To protect child routes in Angular, you use the 'canActivateChild' Route Guard. It allows you to guard access to child routes based on conditions.

When testing Angular pipes, it is crucial to test not only the transformation but also the _______ of the output.

  • Behavior
  • Consistency
  • Performance
  • Structure
When testing Angular pipes, it is crucial to test not only the transformation but also the behavior of the output to ensure correctness.

Which core building block of Angular is responsible for defining views, data, and logic?

  • Component
  • Directive
  • Module
  • Service
In Angular, a Component is responsible for defining views, data, and logic. A Component is the basic building block of an Angular application.

To manually check a component and its children, you can inject the _____ service and call its detectChanges() method.

  • ChangeDetectorRef
  • ComponentCheckService
  • ManualDetectionService
  • OnCheckService
To manually check a component and its children in Angular, you can inject the ChangeDetectorRef service and call its detectChanges() method. This allows you to trigger change detection explicitly, which can be useful in specific scenarios where automatic change detection is not sufficient.

What is the purpose of the finalize operator in an Observable sequence?

  • Combine multiple Observables
  • Complete the Observable
  • Execute code after completion
  • Handle errors in the stream
The purpose of the finalize operator in an Observable sequence is to execute specific code after the Observable has completed, whether successfully or with an error.

The _____ strategy in Angular's change detection checks the component and its children only when an event is fired.

  • Always
  • CheckOnce
  • Default
  • OnPush
The OnPush strategy in Angular's change detection checks the component and its children only when an event is fired, optimizing performance.