i have platform list in my project , i want remove one item from platform list and see update list without reloading platform list image : platform list image
i use ui-route in my project
body of platform-list.html :
<tbody>
<tr ng-repeat="platform in platforms">
<td>{{platform.PlatformID}}</td>
<td>{{platform.Name}}</td>
<td><button ui-sref="platform-edit({id: platform.PlatformID})" class="btn btn-warning">Edit <span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button> |
<button ng-click="remove(platform.PlatformID)" class="btn btn-danger">Delete <span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
</tbody>
platform-list-controller.js :
mainApp.controller('platformListController', function ($scope, platform, $filter) {
platform.query().$promise.then(function (data) {
$scope.platforms = data;
}, function (error) {
});
});
platform model :
public class Platform
{
[Key]
public int PlatformID { get; set; }
public string Name { get; set; }
}
how to write remove code in this controller?