Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
refactor($resource): simplify url template expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed May 8, 2013
1 parent 5137a15 commit ee26890
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ngResource/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* the need to interact with the low level {@link ng.$http $http} service.
*
* # Installation
* To use $resource make sure you have included the `angular-resource.js` that comes in Angular
* To use $resource make sure you have included the `angular-resource.js` that comes in Angular
* package. You can also find this file on Google CDN, bower as well as at
* {@link http://code.angularjs.org/ code.angularjs.org}.
*
Expand Down Expand Up @@ -317,7 +317,7 @@ angular.module('ngResource', ['ng']).
}

function Route(template, defaults) {
this.template = template = template + '#';
this.template = template;
this.defaults = defaults || {};
this.urlParams = {};
}
Expand Down Expand Up @@ -355,8 +355,8 @@ angular.module('ngResource', ['ng']).
}
});

// set the url
config.url = url.replace(/\/?#$/, '').replace(/\/*$/, '');
// strip trailing slashes and set the url
config.url = url.replace(/\/+$/, '');

// set params - delegate param encoding to $http
forEach(params, function(value, key){
Expand Down

0 comments on commit ee26890

Please sign in to comment.