I am using Restangular in my AngularJS application. I have a table with a delete link for each item. I would like to delete the item and automatically delete the row. But since it only removes from the database. How can I reorganize things so that it automatically updates the DOM?
// The controller angular.module('myApp').controller('ManageCtrl', function($scope, Restangular) { $scope.delete = function(e) { Restangular.one('product', e).remove(); }; Restangular.all('products').getList({}).then(function(data) { $scope.products = data.products; $scope.noOfPages = data.pages; }); }); // The view <li ng-repeat="product in products"> <a href="#" ng-click="delete(sheet._id)"></a> </li>
I would also like to find an example of this - even with the Angular resource. All admin / data demo files work with static data.
javascript angularjs angularjs-ng-repeat restangular
cyberwombat
source share