如何在angular 2应用程序中设置baseURL
在my index.html中,我有以下导入->如何在angular 2应用程序中设置baseURL,angular,Angular,在my index.html中,我有以下导入-> <script> System.import('system-config.js').then(function () { System.import('main'); }).catch(console.error.bind(console)); </script> 它在导入行上爆炸了,所以我甚至无法设置baseURL。这是一个使用Angular2的“angularCLI”项目。基本上,如果没有设
<script>
System.import('system-config.js').then(function () {
System.import('main');
}).catch(console.error.bind(console));
</script>
它在导入行上爆炸了,所以我甚至无法设置baseURL。这是一个使用Angular2的“angularCLI”项目。基本上,如果没有设置baseURL,那么它将使用最初从中加载页面的服务器的默认URL。我需要一个不同的URL指向CDN以加载所有前端内容。。html/css/js/angular文件。这可能有点肤浅,给你一个好的答案。你能做一个plunker或类似的东西吗?制作一个小例子通过使用${System.import('${cdnBaseUrl}/app/environment.js')修复它。然后(函数(环境){System.config({baseUrl:environment.cdnBaseUrl});System.import('${cdnBaseUrl}/System config.js')。然后(函数(){System.import('main'));}).catch(console.error.bind(console));});ember提供了关于如何使用设置baseURL->的CDN的清晰文档。“如何使用CDN”部分。。希望你能给出一个好的答案,这可能有点肤浅。你能做一个plunker或类似的东西吗?制作一个小例子通过使用${System.import('${cdnBaseUrl}/app/environment.js')修复它。然后(函数(环境){System.config({baseUrl:environment.cdnBaseUrl});System.import('${cdnBaseUrl}/System config.js')。然后(函数(){System.import('main'));}).catch(console.error.bind(console));});ember提供了关于如何使用设置baseURL->的CDN的清晰文档。“如何使用CDN”部分。。希望您能提供关于baseURL的弃用的良好文档文章->
import { environment } from './app';
const packages: any = {};
System.config({baseURL : environment.cdnBaseUrl});