0

I am getting the following error in my Angular 6 app

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

I have imported the following theme in my app.component.css but I am still getting this error on browser's console

@import url("../../node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css");
Manu Chadha
  • 15,555
  • 19
  • 91
  • 184
  • Possible duplicate of [Angular material Could not find Angular Material core theme](https://stackoverflow.com/questions/44230852/angular-material-could-not-find-angular-material-core-theme) – Manu Chadha May 24 '18 at 16:58

1 Answers1

0

Note the following statement about using pre-built themes in the guide:

If you're using Angular CLI, this is as simple as including one line in your styles.css file

You should have the import statement in your application's main stylesheet - styles.css - not in app.component.css. Also, note another statement in the guide:

The actual path will depend on your server setup.

G. Tranter
  • 16,766
  • 1
  • 48
  • 68