Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular material Could not find Angular Material core theme

Tags:

angular

themes

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?

like image 351
lukassz Avatar asked May 28 '17 18:05

lukassz


People also ask

How do I import angular materials prebuilt themes indigo pink CSS?

In src/styles. css add: @import "~@angular/material/prebuilt-themes/indigo-pink.

Which of the following is not a default theme in angular material?

Angular doesn't have a default theme.


1 Answers

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.

like image 92
codelovesme Avatar answered Oct 10 '22 17:10

codelovesme