I have a list that should simulate a stream:
list = [ {name : 'Str1', age: 10}, {name : 'Str2', age: 10}, {name : 'Str3', age: 10} ];
and I created Observable
from this list:
Observable.from(this.list).skip(this.currentPage * this.pageSize).take(this.pageSize).subscribe(data => this.pagerList = data, console.error);
And in the subscription method, I get the values one by one. How should I wait until all the data is returned, and then to get the whole list. There is a take () statement, and after it the Observable should stop.
I do not want to put each value one by one in the array.
I am new here, not only for angular, but also for javascript.
source share