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 Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming`
The material components not working. Whats wrong?
In src/styles. css add: @import "~@angular/material/prebuilt-themes/indigo-pink.
Angular doesn't have a default theme.
Please insert below code into your styles.css which is located in your src folder.
@import "../node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css";
You can select any css under the prebuilt-themes folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With