angular: HttpClient map response : <p>Currently I'm switching from http (@angular/http) to HttpClient (@angular/common/http) and have problems mapping my response to objects.</p>

<p>Old code (was working before)</p>

<pre><code>this.http.get(environment.baseUrl + '/api/timeslots')
            .map((response: Response) =&gt; {
                    const data = response.json();
                    const timeslots = Array.of&lt;Timeslot&gt;();
                    for (const item of data) {...}
</code></pre>

<p>New code, but compilation error:</p>

<pre><code>this.httpClient.get(environment.baseUrl + '/api/timeslots')
                .map((response: Response) =&gt; {
                        const data = &lt;Timeslot[]&gt; response;
const timeslots = Array.of&lt;Timeslot&gt;();
                    for (const item of data) {...}
</code></pre>

<p>Do I miss a cast? The response is an array of Timeslots. </p>
