To handle errors within an Observable chain, you can use the _____ operator in RxJS.

  • catchError
  • errorHandle
  • handleError
  • mapError
To handle errors within an Observable chain in RxJS, you can use the catchError operator. This operator allows you to gracefully handle errors.

What is the primary purpose of using custom pipes in Angular applications?

  • Create modules and services
  • Handle routing and navigation
  • Modify the component's class properties
  • Transform and format data
The primary purpose of using custom pipes in Angular is to transform and format data before displaying it in the view. Custom pipes allow you to apply specific transformations to data.

What is the primary purpose of unit testing Angular components?

  • Ensure compatibility
  • Test the end-to-end flow
  • Validate REST APIs
  • Verify component templates
The primary purpose of unit testing Angular components is to verify component templates, ensuring they render as expected and contain the desired logic.

To test if a directive correctly updates the host element's properties, you can use the ______ method.

  • debugElement
  • queryHostElement
  • querySelector
  • updateHostProperties
To test if a directive correctly updates the host element's properties, you can use the debugElement method to inspect and manipulate the host element.

In the context of debugging, what does the term "source maps" refer to in Angular applications?

  • Maps of Angular components
  • Maps of geographical areas
  • Maps of runtime errors and bugs
  • Maps of source code
In debugging, "source maps" are mappings of the original source code to the transpiled code, allowing developers to trace errors and debug in the original source.

How can you share a directive among different modules in an Angular application?

  • Import the directive in each module
  • Share the directive through RxJS
  • Use a service
  • Use the @SharedDirective decorator
To share a directive among different modules in an Angular application, you can import the directive in each module where you want to use it. This makes the directive available in those modules, ensuring its shared usage.

What happens when you call the unsubscribe() method on a Subscription?

  • Pauses the Subscription
  • Resumes the Subscription
  • Stops the Subscription
  • Terminates the Subscription
When you call the unsubscribe() method on a Subscription, it stops the Subscription, which means it terminates the connection between the observer and the Observable.

In an Angular application, you want to create an animation where an element fades in and then scales up. Which Angular animation functions would you use to create this effect?

  • Use animate() and style() functions in combination to define keyframes for both fading in and scaling up within the animation.
  • Use fadeIn() and scaleUp() functions provided by Angular's animation module to create the desired animation effect.
  • Use ng-animate directive and CSS classes for fading in and scaling up the element within the animation.
  • Use ng-animate-fade-in and ng-animate-scale-up directives to apply the desired animations to the element.
To create an animation in Angular where an element first fades in and then scales up, you can use the animate() and style() functions in combination. These functions allow you to define keyframes for both fading in and scaling up within the animation, achieving the desired effect.

What is a Subject in the context of RxJS?

  • A design pattern for components
  • A special type of Observable
  • A type of HTTP request
  • An operator for filtering Observables
In RxJS, a Subject is a special type of Observable that allows values to be multicasted to multiple Observers. It can act as both an Observable and an Observer, making it useful for pub-sub patterns.

In a dynamic form, to validate data asynchronously on the server-side, you can use a custom _____ validator.

  • AsyncValidatorFn
  • ObservableValidator
  • SyncValidatorFn
  • ValidatorFn
In a dynamic form in Angular, to validate data asynchronously on the server-side, you can use a custom AsyncValidatorFn.