角材料找不到角材料核心主题 [英] Angular material Could not find Angular Material core theme
问题描述
在我的Angular2项目中,我从 https://material.angular.io/安装了最新的材料插件.指南/入门.接下来,将@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
添加到组件的css文件中.但是在我的控制台中,Angular显示了此错误:
In my Angular2 project I install lastest material plugin from https://material.angular.io/guide/getting-started. Next I add @import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
to my css file for my component. But in my console Angular shows this error:
material.es5.js:148找不到Angular Material核心主题.大多数材料组件可能无法按预期方式工作.有关更多信息,请参阅主题指南: https://material.angular.io/guide/theming`
材料组件不起作用. 怎么了?
The material components not working. Whats wrong?
推荐答案
请在您的 src 文件夹中的 style.css 中插入以下代码.>
Please insert below code into your style.css which is located in your src folder.
@import "../node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css";
您可以在 prebuilt-themes 文件夹下选择任何CSS.
You can select any css under the prebuilt-themes folder.
这篇关于角材料找不到角材料核心主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!