mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-19 16:10:22 +00:00
revert: fix($resource): Route constructor, updated RegExp
This reverts commit 06ed8ef012.
The reverted commit causes regressions. See comments in the PR:
https://github.com/angular/angular.js/pull/1402#issuecomment-12575399
This commit is contained in:
parent
3c2e1c5e4d
commit
ffe5e01584
2 changed files with 1 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue