我想连接这两个对象以获得以下结果$ scope.all = [潜在客户价值和联系价值]

时间:2015-10-05 09:03:01

标签: angularjs

$scope.lead = [
              {name: 'raj', email:'raj@gmail.com'}

            ];
$scope.contact=[
                {name: 'James', email:'james@gmail.com'}

                ];

1 个答案:

答案 0 :(得分:0)

与JS本身相比,看起来与JS更相关。

$scope.lead = [{name: 'raj', email:'raj@gmail.com'}];
$scope.contact =[{name: 'James', email:'james@gmail.com'}];

$scope.all = {};

$scope.all.lead = $scope.lead;
$scope.all.contact = $scope.contact;

console.log(JSON.stringify($scope.all))