title: how to handle array.map inside a map operator of rxjs in angular
body: <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient, HttpResponse } from '@angular/common/http';
  
  import { Observable } from 'rxjs';
  import { catchError } from 'rxjs/operators';
  import 'rxjs/add/observable/throw';
  import { map, tap } from 'rxjs/operators';
  import 'rxjs/add/operator/map'
  import { Entity } from '../models/Entity';
  @Injectable({
    providedIn: 'root'
  })
  export abstract class RestService&lt;T&gt; {
  
    constructor(protected http: HttpClient) { }
    abstract getUri(): string;
    abstract getInstance(): Entity;
    getAll(): Observable&lt;Entity[]&gt; {
      return this.http.get&lt;Entity[]&gt;(`${this.getUri()}`).pipe(map(response =&gt; response.map(item =&gt; { return this.getInstance().deserialize(item) })));
    }
  }
  </code></pre>
  
  <p>I am writing the above code for deserializing my JSON response and I am getting the following error:  </p>
  
  <blockquote>
    <p>core.js:1542 ERROR TypeError: response.map is not a function
            at MapSubscriber.project (rest.service.ts:20)
            at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next
    (map.js:35)
            at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next
    (Subscriber.js:54)
            at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next
    (map.js:41)
            at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next
    (Subscriber.js:54)
            at FilterSubscriber.push../node_modules/rxjs/_esm5/internal/operators/filter.js.FilterSubscriber._next
    (filter.js:38)
            at FilterSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next
    (Subscriber.js:54)
            at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext
    (mergeMap.js:79)
            at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next
    (InnerSubscriber.js:15)
            at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next
    (Subscriber.js:54)</p>
  </blockquote>
  
  <p>I couldn't find a solution to this error. Am I missing something here?</p>