angularjs - Using Angular $resource, Update List of Objects After Post Request -



angularjs - Using Angular $resource, Update List of Objects After Post Request -

in angular, when using $resource, how update list of objects after making post request? if save or update individual object, you'd want the total list reflect alter of data. handled $resource or have implement on own?

you need after update succeeds. how it depends on service homecoming value , approach

using callback approach

some code var r=$resource('searches/:id',null,{ 'update': { method:'put' } }); r.delete({id:id},function(){ $scope.searches.splice(searchidxbyid(id),1); $scope.saved=false; }); r.update({id:id},{},function(){ //success },function(){ //fails });

some reading https://docs.angularjs.org/api/ngresource/service/$resource

angularjs

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -