Skip to content

Commit

Permalink
revert: fix($resource): Route constructor, updated RegExp
Browse files Browse the repository at this point in the history
This reverts commit 06ed8ef.

The reverted commit causes regressions. See comments in the PR:
angular#1402 (comment)
  • Loading branch information
IgorMinar committed Jan 23, 2013
1 parent 3c2e1c5 commit ffe5e01
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion src/ngResource/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down
6 changes: 0 additions & 6 deletions test/ngResource/resourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit ffe5e01

Please sign in to comment.