【发布时间】:2016-03-17 03:18:07
【问题描述】:
我正在尝试将 Angular 2 与 Symfony 3 集成。我使用 npm 安装节点模块,但是我无法从我的视图 base.html.twig 链接它们。事实上,我添加的每个脚本都不起作用(甚至在页面的源代码中也不行)。
以下脚本是必需的,如何添加它们?
<!-- IE required polyfills, in this exact order -->
<script src="../../node_modules/es6-shim/es6-shim.min.js"></script>
<script src="../../node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="../../node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<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>
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('../components/main')
.then(null, console.error.bind(console));
</script>
【问题讨论】:
标签: javascript angular symfony