Complete the code to import the operator used for flattening inner observables.
import { [1] } from 'rxjs/operators';
The switchMap operator is imported from rxjs/operators to flatten inner observables.
Complete the code to use switchMap to flatten the inner observable returned by getData().
this.data$ = this.input$.pipe([1](value => this.getData(value)));switchMap is used here to switch to the observable returned by getData(value) and flatten it.
Fix the error in the code by replacing the incorrect operator with switchMap to flatten the inner observable.
this.result$ = this.source$.pipe([1](val => this.fetchDetails(val)));switchMap is the correct operator to flatten the inner observable returned by fetchDetails(val).
Fill both blanks to create an observable that uses switchMap to flatten and then map to transform the data.
this.final$ = this.input$.pipe([1](val => this.apiCall(val)), [2](data => data.result));
First, switchMap flattens the inner observable from apiCall. Then, map transforms the emitted data to data.result.
Fill all three blanks to create a pipeline that filters input, flattens with switchMap, and taps to log the result.
this.process$ = this.source$.pipe([1](val => val > 10), [2](val => this.loadData(val)), [3](res => console.log(res)));
The pipeline first filters values greater than 10, then uses switchMap to flatten the observable from loadData, and finally uses tap to log the results without affecting the stream.