2
var updFileId = "12345";
$scope.compGridJson = {
"peers": ["localhost:7051", "localhost:8051"],
"fcn": "move",
"args": ["compGridDetails", "{" +
"\"FromParty\":\"Valuelabs\",\"CreatedState\":\"24/08/2017\",\"FileUId\":\"+updFileId+\",\"Status\":\"ValueLabs Change Request\"}"
]
}
$http({
method: "POST",
url: "http://localhost:4000/channels/mychannel/chaincodes/changedneww727",
data: $scope.compGridJson,
headers: {
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
}
}).success(function(data, status, headers, config) {
}).error(function(data, status, headers, config) {
});
以上是我的代码。在“FileUId”的Json数据中,我正在动态地传递数据。但它不是动态获取数据。我为这个价值改变了很多方法,但并没有动态地进行。我想动态地传递这个“12345”的值。可以帮助我。无法在json数据中动态传递数据
有什么,而不是'12345'? – lumio
你不是以'+ updFileId +'为结尾的字符串。它应该看起来像'... \“FileUId \”:\“”+ a +“\”...' –
@Björn它的工作谢谢你 –