2017-06-13 44 views
4

我正在關注的Getting Started說明添加材料零件的網頁,和我得到第4步以下錯誤:如何將Material Components Web與Angular CLI項目集成?

<script>mdc.autoInit()</script> 
-> Uncaught ReferenceError: mdc is not defined at (index):17 

如前所述,這是一個角度CLI項目,所以腳本正在從.angular-cli.json文件加載:

"scripts": [ 
    "../node_modules/material-components-web/dist/material-components-web.js" 
] 

是否有CLI設置我應該加載該文件,或使呼叫mdc.autoInit()另一個地方?

我也看過Angular 2 Framework Integration的例子,它沒有幫助。它不使用CLI,也不會調用mdc.autoInit()

回答

-1

在每個項目中都有一個index.html文件。你需要把你的腳本放在那裏。

相關問題