title: map is not a function rxjs angular
body: <p>I'm new to RXJS and I'm struggling a bit to get the following code to work.
  In angular I'm doing a call to a REST API and the rest API returns an array. I only need certain data from the API in my model. I'm trying to do this with RXJS (so no forEach, ...) and this is what I have so far:</p>
  
  <pre><code>import { Injectable, OnInit } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { DataPackage } from './models/data-package';
  import { Observable } from 'rxjs';
  import { map } from 'rxjs/operators';
  
  @Injectable({
    providedIn: 'root'
  })
  export class PackageService implements OnInit{
  
    constructor(private http: HttpClient) { }
  
    getPackages(): Observable&lt;DataPackage&gt; {
      return this.http
      .get&lt;any&gt;('http://dummy.restapiexample.com/api/v1/employees')
      .pipe(
        map((data: any[]) =&gt;
          data.map(
            (response: any) =&gt;
              new DataPackage(response.employee_name, response.employee_salary, response.employee_age, new Date())
          )
        )
      );
    }
  
    ngOnInit() {      
  
    }
  }
  </code></pre>
  
  <p>I'm getting the following error</p>
  
  <pre><code>ERROR TypeError: "data.map is not a function"
      getPackages package.service.ts:19
  </code></pre>