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.

In Angular testing, the _____ function is used to simulate user interactions on elements.

  • expect
  • mock
  • query
  • trigger
In Angular testing, the trigger function is used to simulate user interactions on elements, such as clicks, inputs, and other events.

The RxJS operator _____ is used to delay the emissions from an Observable.

  • debounceTime
  • filter
  • mergeMap
  • skip
The RxJS operator debounceTime is used to delay the emissions from an Observable. It's often used for scenarios like handling user input and performing searches with a delay.

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.

Which Router Event is fired when navigation is canceled?

  • NavigationCancel
  • NavigationEnd
  • NavigationError
  • NavigationStart
The NavigationCancel event is fired when navigation is canceled in Angular. It can be used to perform actions when navigation is interrupted.

In Angular, the _____ Guard checks whether a route can be deactivated.

  • CanActivate
  • CanActivateChild
  • CanDeactivate
  • CanLoad
In Angular, the CanDeactivate Guard checks whether a route can be deactivated, allowing you to confirm or prevent the user's navigation away from the current route.