diff options
| author | Fredrik Bonander | 2013-01-23 10:53:49 +0100 |
|---|---|---|
| committer | Misko Hevery | 2013-02-14 14:43:31 -0800 |
| commit | 6194e002e2f8860218076a7a5ecf945b0d981843 (patch) | |
| tree | 3ac736f09c690ee844a8b56dfde8a7b823627f04 /src | |
| parent | 75545d4d1c59192d781bb23d8bd2f72c9be37d38 (diff) | |
| download | angular.js-6194e002e2f8860218076a7a5ecf945b0d981843.tar.bz2 | |
fix(resource): Update RegExp to allow urlParams with out leading slash
Will allow reoucese to be loaded from a relative path
Example:
var R = $resource(':path');
R.get({ path : 'data.json' });
Example usage:
Load resources in applications not using webserver, ie local webapp in
on a tablet.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngResource/resource.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 876035c4..914de226 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -270,7 +270,7 @@ angular.module('ngResource', ['ng']). this.defaults = defaults || {}; var urlParams = this.urlParams = {}; forEach(template.split(/\W/), function(param){ - if (param && template.match(new RegExp("[^\\\\]:" + param + "\\W"))) { + if (param && (new RegExp("(^|[^\\\\]):" + param + "\\W").test(template))) { urlParams[param] = true; } }); |
