I'm trying to wrap my head around RXJS.
I'm getting an array of Things via an http request.
But I'm having trouble taking a number of those objects.
Here's my method.
getThingsById(ID: number): Observable<IThing[]> {
return this._http.get(this.URL + ID + '/things)
.map((response: Response) => <IThing[]>response.json())
.take(20);
}
When I try to take 20 of those things I get all of them.
What am I doing wrong?
Thanks!
take()anything since NG2 does it for you. Look at the HttpService method : i.sstatic.net/GLkR7.png. You can take your response from the parsed json and use the Array.filter()method