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.

In a complex application, you want to implement a global notification system that allows various components to send and receive messages. Which RxJS class would be best suited to implement this system?

  • AsyncSubject
  • BehaviorSubject
  • ReplaySubject
  • Subject
To implement a global notification system where various components can send and receive messages, Subject is a suitable choice. Subjects allow multicasting and can be used to create a central messaging hub in your application.

You are building a survey application where the questions change based on the user's previous responses. Which feature of Angular forms would be best suited to create this kind of dynamic behavior?

  • Both Reactive and Template-driven Forms
  • Custom Form Validation
  • Reactive Forms
  • Template-driven Forms
To create a dynamic form that changes based on user responses, Reactive Forms are best suited. Reactive Forms offer more flexibility and control in creating dynamic forms.

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.

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.

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.

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.

Custom directives in Angular can be used to extend the behavior of _____.

  • components
  • directives
  • modules
  • services
Custom directives in Angular can be used to extend the behavior of directives. Directives are a fundamental part of Angular and provide the ability to create custom behaviors and interactions that can be added to elements in the DOM. Custom directives enable developers to create reusable functionality.

To create a custom pipe in Angular, you need to decorate a class with the _____ decorator.

  • @Component
  • @Injectable
  • @NgModule
  • @Pipe
To create a custom pipe in Angular, you need to decorate a class with the @Pipe decorator. This decorator is used to define a custom pipe.

The _____ operator can be used to combine multiple Observables, emitting values sequentially in the order they were provided.

  • forkJoin
  • mergeMap
  • switchMap
  • zip
The mergeMap operator can be used to combine multiple Observables, emitting values sequentially in the order they were provided. It's often used for HTTP requests.

What kind of behavior is typically tested in a custom Angular directive?

  • Component rendering
  • Component routing
  • Directive behavior
  • Module imports
In Angular, custom directives are typically tested to validate their directive behavior and ensure they manipulate the DOM as intended.

In Angular, the _____ directive is used to conditionally render content in the DOM.

  • *ng-if
  • *ng-if-else
  • *ng-show
  • *ng-switch
In Angular, the *ng-if directive is used to conditionally render content in the DOM based on a provided condition.