0
我通过刷新页面来更新视图。我知道有更好的办法。可有人告诉我如何更新视图数据而无需刷新页面:角度更新视图,无需刷新页面
myApp.service("deleteService", function ($http) {
this.removeRow = function (recId, compName, custName, docName) {
$http.post('DeleteRecord', { settingID: recId,companyName: compName,customerName: custName, documentName: docName })
.success(function (data, status, headers, config) {
window.location.reload();
})
.error(function (data, status, header, config) {
});
}
});
调用你用来获取视图数据的相同函数,在删除成功里面 –
更新视图是什么意思?更新模型绑定?在成功事件中,您可以在模型中设置绑定,视图将反映这些更改。 – lintmouse
谢谢,请告诉我该怎么做。 – user6440175