javascript - Join two objects in AngularJs -


i need join 2 json object using angularjs.

my object example:

 {   "details1" : [ {     "details1id" : 119,     "details1title" : "title1",     "details1description" : "description1"    } ],   "details2" : [ {     "details2id" : 150,     "details2title" : "title2",     "details2description" : "description2"    } ] } 

i have objcet need join details2 details1

i need result in following manner. possible angularjs ? please suggest

{   "details1" : [ {     "details1id" : 119,     "details1title" : "title1",     "details1description" : "description1"    } ,{    "details2id" : 150,     "details2title" : "title2",     "details2description" : "description2"   }] } 

you may try this,

$scope.jsonarray['details1'].push($scope.jsonarray['details2'][0]) 

where $scope.jsonarray variable storing json, may use other variable.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -