【问题标题】:Integrate MDL with Angular 2将 MDL 与 Angular 2 集成
【发布时间】:2017-09-05 01:51:39
【问题描述】:

MDL 在我的环境中不适用于 Angular。 我继续本教程:

https://getmdl.io/started/index.html

这些库存在于 node_modules 中,但调试器显示消息:

[WDS] App updated. Reloading...
login:10 GET http://localhost:4200/node_modules/material-design-lite/material.min.css 
login:11 GET http://localhost:4200/node_modules/material-design-lite/material.min.js 
login:12 GET http://localhost:4200/node_modules/material-design-icons/iconfont/material-icons.css 
Navigated to http://localhost:4200/login
lang.js:130 Angular is running in the development mode. Call enableProdMode() to enable the production mode.

【问题讨论】:

    标签: angular angular2-mdl


    【解决方案1】:

    从 mdl 导入一些脚本是不够的。需要做更多的工作,或者您可以使用一个包装器库来为您处理大部分工作:https://github.com/mseemann/angular2-mdl

    【讨论】:

    • 哦,它有点复杂.. 我开始使用 Angular(我讨厌它......)有一些最简单的东西??