TS Error: flatMap, flat, flatten do not exist for type any[] in Angular
Hi everyone! I'm new to TypeScript and Angular, and I've encountered a strange problem. I have a service that receives data from an API. The data comes as an array of objects, each containing nested arrays. I need to flatten these nested arrays into a single flat list.
Here's a simplified version of my service code:
```typescript
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
interface Order {
id: number;
items: string[];
}
@Injectable({ providedIn: 'root' })
export class DataService {
constructor(private http: HttpClient) {}
getAllItems(): Observable {
return this.http.get('/api/orders').pipe(
map(ord