javascript - how do I add data manipulation to the $resource object? -


as per android-phone tutorial, i'm using $resource object add convenient way grab data , have lazily loaded scoped variable. issue want have query manipulates data grabbed $resource , returns that. don't see way resource.

does know how manipulate data returned $resource? or can recommend me lazy loaded way this. function doesn't need custom tailored $resource appears to rest.

(note: angular seems way more complicated should be, i'm thinking because of lack of tutorials. [also can't stand video tutorials, because boring , time consuming , not conveniently interactive text tutorials])

$resource uses promises and/or callbacks, $http.

example:

var user = $resource('/user/:userid', {userid:'@id'}); var user = user.get({userid:123}, function() {     // user     user.abc = true;     user.$save(); }); 

or:

var user = $resource('/user/:userid', {userid:'@id'}); user.get({userid:123}, function(user) {     // user     user.abc = true;     user.$save(); }); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -