diff --git a/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js b/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js index 1d873b70c5..a0f7c54538 100644 --- a/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js +++ b/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js @@ -3,15 +3,17 @@ var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g; var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g; module.exports.translate = function(load){ - - var url = new URL(load.address); + var url = document.createElement('a'); + url.href = load.address; var basePathParts = url.pathname.split('/'); basePathParts.pop(); var basePath = basePathParts.join('/'); - var baseHref = new URL(this.baseURL).pathname; + var baseHref = document.createElement('a'); + baseHref.href = this.baseURL; + baseHref = baseHref.pathname; basePath = basePath.replace(baseHref, ''); @@ -23,16 +25,16 @@ module.exports.translate = function(load){ resolvedUrl = basePath + url.substr(1); } - return `templateUrl: '${resolvedUrl}'`; + return 'templateUrl: "' + resolvedUrl + '"'; }) .replace(stylesRegex, function(match, relativeUrls) { var urls = []; while ((match = stringRegex.exec(relativeUrls)) !== null) { if (match[2].startsWith('.')) { - urls.push(`'${basePath}${match[2].substr(1)}'`); + urls.push('"' + basePath + match[2].substr(1) + '"'); } else { - urls.push(`'${match[2]}'`); + urls.push('"' + match[2] + '"'); } }