Solved

Need to join two Angular Array Objects

Posted on 2013-12-12
4
294 Views
Last Modified: 2013-12-13
I need to join two javascript json arrays and push the concat into one

                for (var z = 0; i < data.length; z++) {
                    var dlist = data[z];
                              
                    for (var j = 0; j < verifyWMRList.length; j++) {

                        var vlist = verifyWMRList[j];

                        if (dlist.Email == vlist.CRMMemberEmail) {                            

Right here I need dlist and vlist to be 1 array row and push it onto my $scope.items

                            $scope.items.push(   Joined Array );
                           
                        }

                    }
                }

Open in new window


Thank  You
0
Comment
Question by:charlesbaldo
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39715497
what about :

$scope.items.push(   dlist.concat( vlist )   );
0
 

Author Comment

by:charlesbaldo
ID: 39715511
clever but I get an error

Error: dlist.concat is not a function
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39715520
Try this :
$scope.items.push(   dlist   );
$scope.items.push(   vlist   );
0
 

Author Closing Comment

by:charlesbaldo
ID: 39716767
Thnaks Again your help made the diff
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question