我在函数中有一个POST请求。我看到POST请求正确获取数据,但由于某种原因,范围值不会更新。在控制器启动时,相同的请求可以正常运行
$http.post('/api/v1/manual/create/edit?value='+$scope.edit,$scope.manual).success(function (data) {
$modalInstance.dismiss('cancel');
$scope.manual = data;
ManualService.setManual('');
}).error(function (data, status) {
console.log('Error ' + data)
})
POST回复
[
{
"id":"5861f0ef4b282671e3da4bc8",
"name":"Test",
"version":"1.0.0",
"details":"\u003cp\u003eTest\u003c/p\u003e",
"createdOn":"Dec 26, 2016 8:41:19 PM",
"testType":[
{
"name":"Mobile",
"issues":"0",
"scanned":false,
"percentAudit":"0"
},
{
"name":"Database",
"issues":"0",
"scanned":false,
"percentAudit":"0"
},
{
"name":"Web/Api",
"issues":"0",
"scanned":false,
"percentAudit":"0"
},
{
"name":"Network",
"issues":"0",
"scanned":false,
"percentAudit":"0"
}
]
}
]
在上面的代码中,$ scope.manual的值即使响应获得所有正确的值也不会更新。