aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ngResource/resource.js2
-rw-r--r--test/ngResource/resourceSpec.js6
2 files changed, 1 insertions, 7 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index 549226a2..7e26a6a4 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -290,7 +290,7 @@ angular.module('ngResource', ['ng']).
this.defaults = defaults || {};
var urlParams = this.urlParams = {};
forEach(template.split(/\W/), function(param){
- if (param && (new RegExp("((\\w|\\/|^)(?!\\\\:" + param + ")):" + param + "\\W")).test(template)) {
+ if (param && template.match(new RegExp("[^\\\\]:" + param + "\\W"))) {
urlParams[param] = true;
}
});
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js
index cf3b886b..33dc6d5b 100644
--- a/test/ngResource/resourceSpec.js
+++ b/test/ngResource/resourceSpec.js
@@ -129,12 +129,6 @@ describe("resource", function() {
R.get({a: 'doh@fo o', ':bar': '$baz@1', '!do&h': 'g=a h'});
});
- it('should allow relative paths in resource url', function () {
- var R = $resource(':a');
- $httpBackend.expect('GET', 'data.json').respond('{}');
- R.get({ a: 'data.json' });
- });
-
it('should encode & in url params', function() {
var R = $resource('/Path/:a');