1

my result my result how to get how to get first image is my console log result.

how to get the second image in angular 2 Push Method?

this.limitid = "0";
 this.userService.getTestUsers(this.limitid).subscribe(users => this.users = users);

this.limit = "12";
 this.userService.getTestUsers(this.limit).subscribe(usersnew => this.usersnew = usersnew);

this.users.push(this.usersnew[0]);

console.log(this.users);

the first index(11) objects is this.users results.

the index(12) objects is this.usersnew results.

my question is how to get the index(12) inside objects continues of index(11) to index(23)

image 1

kathir
  • 4,255
  • 2
  • 15
  • 25

2 Answers2

3

Use ES6 syntax (short and simple):

this.users = [...this.users , ...this.usersnew];
Vivek Doshi
  • 56,649
  • 12
  • 110
  • 122
1
this.results = this.users.concat(this.usersnew);

Now your new array would be in this.results

AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57