diff options
| author | Fredrik Bonander | 2013-01-23 10:53:49 +0100 | 
|---|---|---|
| committer | Misko Hevery | 2013-02-14 14:43:55 -0800 | 
| commit | b7e1fb0515798e1b4f3f2426f6b050951bee2617 (patch) | |
| tree | f3d66cc9a9a1cdf818ae9d404dfba10f25b55c0f /src | |
| parent | 755beb2b66ce9f9f9a218f2355bbaf96d94fbc15 (diff) | |
| download | angular.js-b7e1fb0515798e1b4f3f2426f6b050951bee2617.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 81b57f43..484e9b01 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -308,7 +308,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;          }        });  | 
