I simply try to .take(5) from an http returned observable:
this.dataObservable = this._service.getData()
.take(5);
and use it in HTML like so:
<tr *ngFor="let record of dataObservable | async">
This works. But I get all the records, I just want 5. What am I doing wrong? Thanks.
In the _service I return the http observable:
getData(): Observable<any> {
url = '/getData';
this._data = this._http.get(url)
.map(response => this.extractData(response));
return this._data;
}