传递变量json数组值

时间:2017-06-19 10:12:50

标签: javascript angularjs json

嗨抱歉标题我真的不知道从哪里开始,我只是想在JSON数组值中传递我的变量,如果那是什么叫..我只是用代码解释

所以基本上这是我的变量,这个变量里面的动态变化取决于API请求

$scope.sampleConfig.default_sale_tax_code <-- Example inside of this variable is OUTPUT

现在我在lodash中使用_.map($scope.taxCode, sampleFunction)地图也有这个充满了json arry的功能

function sampleFunction(value) {
            var sample = $scope.sampleConfig.default_sale_tax_code;
            $scope.sampleASD = value,sample
            console.log($scope.sampleASD)
        }

现在我的问题是如何将我的变量放到value.(put variable here)我尝试了以下内容......

 $scope.sampleASD = value,sample <-- it just return all the datas
 $scope.sampleASD = value.sample < --- it just return undefined
 $scope.sampleASD = value  + sample <-- it just return an [object object]OUTPUT... OUTPUT is the variable string inside of my $scope.sampleConfig.default_sale_tax_code

0 个答案:

没有答案