Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-restful-resource

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-restful-resource - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

12

angular-restful-resource.js
'use strict';
angular.module('ngRestfulResource', ['ngResource']).factory('$restfulResource', ['$resource', function ($resource) {
return function (url, params, methods) {
return function (url, params, methods, options) {
methods = angular.extend({

@@ -10,9 +10,13 @@ update: { method: 'PUT' },

options = angular.extend({
idAttribute: 'id'
}, options);
var resource = $resource(url, params, methods);
resource.prototype.$save = function () {
if (!this.id) {
if (this[options.idAttribute]) {
this.$update.apply(this, arguments);
} else {
this.$create.apply(this, arguments);
} else {
this.$update.apply(this, arguments);
}

@@ -19,0 +23,0 @@ };

@@ -0,0 +0,0 @@ The MIT License

@@ -11,3 +11,3 @@ {

"main": "angular-restful-resource.js",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",

@@ -14,0 +14,0 @@ "repository": {

@@ -0,0 +0,0 @@ angular-restful-resource

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc