怎麼能檢查什麼是真正happning客棧刪除功能上的資源,因爲每次我刪除它的時候說的成功,但是在UI犯規更新檢查刪除和更新UI的角度ngResource模塊
我的HTML
<md-content >
<div id="main" class="well">
<table cellpadding="20" class="table table-bordered table-striped">
<tr>
<th ng-repeat="(head, value) in models[0]"><span>{{head}}</span></th>
</tr>
<tr ng-repeat="row in models">
<td ng-repeat="(name, value) in row" ng-scope>
<span ng-click="" ng-bind="row[name]"></span>
</td>
<td >
<a target="_self" href="#" ng-click="downlaodId(row)">Downlaod</a>
</td>
<td >
<a target="_self" href="#" ng-click="deleteId(row)"
confirmation-needed="Really Delete?">Delete</a>
</td>
</tr>
</table>
</div>
</md-content>
我的控制器
$scope.deleteId = function (idPassed) {
fileLoadService.delete({ 'id': idPassed.id },function(successResult) {
alert('Deleted');
}, function (errorResult) {
// do something on error
if (errorResult.status === 404) {
alert('Ooops');
}
});
};
我的UI看起來是這樣的後單擊刪除 fileLoadservice
app.factory('fileLoadService', ['$resource',
function ($resource) {
return $resource(
"http://jsonplaceholder.typicode.com/todos/:id",
{ id: "@id" },
{
"query": { 'method': 'GET', isArray: true }
});
}]);
您應該更新您的刪除 – user2718281