Skip to content

eduardomb/ng-resource-etag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-resource-etag

This is a fork of AngularJS 1.5.3 ng-resource module to support eTag on If-Match header.

Install

bower install ng-resource-etag

Usage

A new argument ifMatch can be passed to each resource action. This argument should contain the name of the key that holds the eTag on the resource instance.

var User = $resource('/user/:userId', {userId:'@id'}, {
    update: {'method': 'PATCH', ifMatch: '_etag'}
});

User.get({userId:123}, function(u) {
  console.log(u._etag);  // This must return the _etag
  u.abc = true;  // Change the original user
  u.$update();
});

Full Documentation

Full documentation is available on the AngularJS docs site.

About

AngularJS ng-resource fork to support eTag on If-Match header

Resources

License

Stars

Watchers

Forks

Packages

No packages published