我开始使用 Angular Material 库作为界面在 Angular 中开发一个 Web 应用程序。但我在尝试导入预建主题时遇到错误。为了导入它,我添加了<link rel="stylesheet" href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css">
to my index.html
文件但是当我运行时ng serve
我无法获取该文件。
如果您正在使用angular-cli
跟随他们的包含 Angular-Material 的步骤 https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/include-angular-material.md.
确保您有以下进口src/styles.css
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
@import '~https://fonts.googleapis.com/icon?family=Material+Icons';
与什么略有不同angular-material
自己建议入门网站,但它对我有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)