Issue
this array contains atleast 10 objects
array: any[] = [];
When a function is called, an array is expected to contain both existing and new objects from "item".
function () {
var timeline = this.service.fetchservice(10)
.map((result : Response) => result.json())
.subscribe(item=> {
this.array.push(item);
});
}
error in console
ERROR TypeError: _this.array.push is not a function
Solution
something like:
this.results = this.results.concat(data.results);
Answered By - Carsten
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.