我正在遵循为web添加材料组件的Getting Started说明,并且在第4步中得到以下错误:
<script>mdc.autoInit()</script>
-> Uncaught ReferenceError: mdc is not defined at (index):17如前所述,这是一个Angular CLI项目,因此脚本是从.angular-cli.json文件加载的:
"scripts": [
"../node_modules/material-components-web/dist/material-components-web.js"
]在命令行界面设置中,是否还有我应该加载文件或调用mdc.autoInit()的位置
我还查看了Angular 2 Framework Integration示例,它没有任何帮助。它不使用命令行界面,也从不调用mdc.autoInit()。
发布于 2017-06-13 22:16:06
在每个项目中都有一个index.html文件。你需要把你的脚本放在那里。
https://stackoverflow.com/questions/44523515
复制相似问题