Guest User

Untitled

a guest
Mar 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public webdesign: Array<WebDesign>;
  2.  
  3. loadMore() : void
  4. {
  5. this.apollo.query(`{
  6. getWebDesignList (page : ${this.page++}) {
  7. _id
  8. title
  9. description
  10. creatorName
  11. createdAt
  12. }
  13. }`).subscribe(r => {
  14. r.data.getWebDesignList.forEach(e => this.webdesign.push(e));
  15. //TypeError: Cannot add property 2, object is not extensible
  16. });
  17. }
  18.  
  19. let temp = JSON.parse(JSON.stringify(this.webdesign));
  20. for (let i = 0; i < r.data.getWebDesignList.length; i++) {
  21. temp.push(r.data.getWebDesignList[i]);
  22. }
  23. this.webdesign = temp;
Add Comment
Please, Sign In to add comment