When pushing an array\'s contents to another array I get
\"Uncaught TypeError: Cannot read property \'push\' of undefined\" error in this snippet.
This error occurs in angular when you didn't intialise the array blank. For an example:
userlist: any[ ]; this.userlist = [ ];
or
userlist: any = [ ];