如何将内部数组添加到JSON对象以保存到Mongodb?

时间:2016-05-03 10:16:24

标签: angularjs mongodb

$scope.createProduct = function () {
        console.log("inside createProduct click")
        console.log($scope.Product);
        console.log($scope.selectedGroups);
        $http.post('Product/CreateProduct', $scope.Product).success(function (response) {
            console.log(response);
            console.log(response.success);
            if (response.success == true) {
                $scope.status = "Successfully Created Product";
                $mdDialog.hide();
            }
        });
    };

以上是我的发布代码。我想将"$scope.selectedGroups"添加到$scope.Product

例如:

$scope.Product = { 
    "ProductName": "FirstProduct",
    "ContentLink:  "SampleLink"
    "SelectedGroups":{"one"},{"two"},{"three"}
}

此处"SelectedGroups"= $scope.selectedGroups

如何从控制器附加此内容

0 个答案:

没有答案