【发布时间】:2016-07-15 11:48:11
【问题描述】:
我正在使用以下代码从 angularjs 表中删除一行:
$scope.removeRow = function (index) {
if (index === -1) {
alert("Something gone wrong");
}else{
$scope.budgetdetails.splice(index,1);
}
但是我的 json 数据和数据库没有更新。我需要做什么来更新它们中的数据?
【问题讨论】:
-
需要使用
$http将该信息发送到服务器,服务器将更新数据库。为了做到这一点,您需要将整个对象传递给您的函数,以便您有 id 发送...然后自己索引它 -
谢谢charlieftl。我正在读那个。有什么好的例子可以指点我吗?
-
这会有所帮助。在你的 ajax 承诺回调中使用它stackoverflow.com/questions/15453979/…
标签: angularjs json asp.net-mvc-4