【发布时间】:2016-07-07 08:03:06
【问题描述】:
我正在关注来自 angular.io 的 Angular2 快速入门指南 他们利用 systemJs 来加载应用程序。
angular2、rx.js 和 angular2.dev.js 是通过脚本引用加载的,而不是导入 ..
有没有办法导入这些脚本?
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<!-- 2. Configure SystemJS -->
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/main')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<app>Loading...</app>
</body>
【问题讨论】: