mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
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')
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user