What is the difference between the concat and merge operators when combining Observables?

  • Concat combines the latest values from all Observables, while merge combines them sequentially.
  • Concat emits values from the first Observable only, while merge emits values from all Observables as they arrive.
  • Concat subscribes to Observables sequentially, while merge subscribes to them concurrently.
  • Concat waits for all Observables to complete before emitting values, while merge emits them as they arrive.
The main difference is that the concat operator subscribes to Observables sequentially, whereas the merge operator subscribes to them concurrently.

What is the main difference between hot and cold observables in Angular?

  • Cold observables emit values when subscribed to.
  • Cold observables share their subscription with all subscribers.
  • Hot observables emit values when subscribed to.
  • Hot observables share their subscription with all subscribers.
The main difference between hot and cold observables is that hot observables emit values when subscribed to, while cold observables emit values individually for each subscriber.

Karma can automatically watch your files for changes and re-run tests using the _____ configuration option.

  • Auto
  • Refresh
  • Watch
  • Update
Karma can automatically watch your files for changes and re-run tests using the Watch configuration option, improving test efficiency.

Jasmine allows you to set up initial conditions for your tests in a block known as _____.

  • Arrange
  • Before
  • Prepare
  • Setup
In Jasmine, you can set up initial conditions for your tests in a block known as Arrange to ensure a clean test environment.

In a Protractor test, how can you interact with a button element on a webpage?

  • browser.findElement(By.button())
  • button.click()
  • element(by.button())
  • element(by.id())
To interact with a button element in Protractor, you typically use the button.click() method to simulate a click on the button.

When you want an Observable to emit a sequence of values over time, you would use _____.

  • interval()
  • map()
  • of()
  • timer()
When you want an Observable to emit a sequence of values over time, you would use interval(). The interval() operator emits values at specified time intervals.

What can a Route Resolver return to indicate that the route data is not available?

  • Empty object
  • Null
  • Observable with an error
  • Undefined
A Route Resolver can return an Observable with an error to indicate that the route data is not available or there was an issue fetching it.

How can you handle errors within a Route Resolver?

  • Handle errors outside the resolver
  • Log the error to the console
  • Redirect to an error page
  • Rethrow the error to the component
To handle errors within a Route Resolver, you can rethrow the error to the component using an observable with catchError.

Angular's change detection mechanism ensures that the _____ is in sync with the component's state.

  • DOM
  • model
  • template
  • view
Angular's change detection mechanism ensures that the DOM is in sync with the component's state, ensuring that the view is up-to-date.

The process of synchronizing the model and the view in both directions is known as _____ data binding.

  • Bi-directional
  • One-way
  • Two-directional
  • Two-way
The process of synchronizing the model and the view in both directions is known as Two-way data binding in Angular.