mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 07:14:44 +00:00
refactor($resource): simplify url template expansion
This commit is contained in:
parent
5137a15417
commit
ee2689051b
1 changed files with 4 additions and 4 deletions
|
|
@ -317,7 +317,7 @@ angular.module('ngResource', ['ng']).
|
||||||
}
|
}
|
||||||
|
|
||||||
function Route(template, defaults) {
|
function Route(template, defaults) {
|
||||||
this.template = template = template + '#';
|
this.template = template;
|
||||||
this.defaults = defaults || {};
|
this.defaults = defaults || {};
|
||||||
this.urlParams = {};
|
this.urlParams = {};
|
||||||
}
|
}
|
||||||
|
|
@ -355,8 +355,8 @@ angular.module('ngResource', ['ng']).
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// set the url
|
// strip trailing slashes and set the url
|
||||||
config.url = url.replace(/\/?#$/, '').replace(/\/*$/, '');
|
config.url = url.replace(/\/+$/, '');
|
||||||
|
|
||||||
// set params - delegate param encoding to $http
|
// set params - delegate param encoding to $http
|
||||||
forEach(params, function(value, key){
|
forEach(params, function(value, key){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue