angular-resource
Advanced tools
Comparing version
var path = require('path'); | ||
var bind = function(appMethod, url, middleware, instanceMethod) { | ||
var bind = function(app, appMethod, url, middleware, instanceMethod) { | ||
if(instanceMethod) { | ||
if(middleware) { | ||
return appMethod(url, middleware, instanceMethod); | ||
return app[appMethod](url, middleware, instanceMethod); | ||
} else { | ||
return appMethod(url, instanceMethod); | ||
return app[appMethod](url, instanceMethod); | ||
} | ||
@@ -18,6 +18,6 @@ } | ||
bind(app.get, iduri, middleware, r.get); | ||
bind(app.post, iduri, middleware, r.save); | ||
bind(app.get, uri, middleware, r.query); | ||
bind(app['delete'], iduri, middleware, r.remove); | ||
bind(app, 'get', iduri, middleware, r.get); | ||
bind(app, 'post', iduri, middleware, r.save); | ||
bind(app, 'get', uri, middleware, r.query); | ||
bind(app, 'delete', iduri, middleware, r.remove); | ||
}; |
{ | ||
"name": "angular-resource", | ||
"description": "AngularJS $resource bindings for express.", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"licenses": [{ | ||
@@ -6,0 +6,0 @@ "type": "MIT", |
5079
0.47%