如何在angularjs中连接api输入

时间:2018-05-14 06:45:42

标签: javascript html angularjs

我的文件API代码

var enquiryDetails = {
  "source":"https://enroll.unicity.com",
  "customer" : {
    "id": {"unicity": $scope.id}, 
    "phone": $scope.phone, 
    "email": $scope.email, 
    "humanName": {"fullName": $scope.name}
  }, 
  "place": $scope.place,
  "subject": $scope.Subject,
  "contact":$scope.Contact,
  "message":$scope.message,
  "market": "IN"
};

我想如下。

Message: Subject: "Entered Subject"

Contact for: "Selected Contact For"

"Actual Message"

1 个答案:

答案 0 :(得分:0)

使用

var enquiryDetails = {
  "source":"https://enroll.unicity.com",
  "customer" : {"id": {"unicity": $scope.id}, 
  "phone": $scope.phone, 
  "email": $scope.email, 
  "humanName": {"fullName": $scope.name}}, 
  "place": $scope.place,
  "subject": "Subject: "+$scope.Subject,
  "contact": "Selected Contact For" + $scope.Contact,
  "message":$scope.message,
  "market": "IN"
};

它会像...一样正常工作。

"subject": "Subject: "+$scope.Subject,
"contact": "Selected Contact For :" + $scope.Contact,