diff options
| author | Igor Minar | 2011-12-12 13:38:50 -0800 | 
|---|---|---|
| committer | Igor Minar | 2012-03-20 11:07:37 -0700 | 
| commit | 6d6f875345e01f2c6c63ef95164f6f39e923da15 (patch) | |
| tree | 2f7bb73eea09941723834e24cb162f2683b59c17 /src | |
| parent | a4fe51da3ba0dc297ecd389e230d6664f250c9a6 (diff) | |
| download | angular.js-6d6f875345e01f2c6c63ef95164f6f39e923da15.tar.bz2 | |
fix($resource): support escaping of ':' in resource url
So one can how define cors/jsonp resources with port number as:
resource.route('http://localhost\\:8080/Path')
Diffstat (limited to 'src')
| -rw-r--r-- | src/Resource.js | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/src/Resource.js b/src/Resource.js index 3b4a6db1..64c8c159 100644 --- a/src/Resource.js +++ b/src/Resource.js @@ -1,16 +1,15 @@  'use strict'; - -  function Route(template, defaults) {    this.template = template = template + '#';    this.defaults = defaults || {};    var urlParams = this.urlParams = {};    forEach(template.split(/\W/), function(param){ -    if (param && template.match(new RegExp(":" + param + "\\W"))) { +    if (param && template.match(new RegExp("[^\\\\]:" + param + "\\W"))) {        urlParams[param] = true;      }    }); +  this.template = template.replace(/\\:/g, ':');  }  Route.prototype = { | 
