1

I want to use angular material but facing the problem while importing angular material theme css file - I imported <link href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet"> in the index.html but I have this error =>

Getting the following error - 'http://localhost:8081/node_modules/@angular/material/prebuilt-themes/indigo-pink.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

How do I have to make it work please? I don't have angular.json or angular-cli.json

kboul
  • 13,836
  • 5
  • 42
  • 53
Lud
  • 286
  • 2
  • 10

1 Answers1

-2

Please Refer Docs there is specific steps to get started,

Step 4 from Material Doc,

Step 4: Include a theme

Including a theme is required to apply all of the core and theme styles to your application.

To get started with a prebuilt theme, include one of Angular Material's prebuilt themes globally in your application. 

If you're using the Angular CLI, you can add this to your styles.css or styles.scss:

@import "~@angular/material/prebuilt-themes/indigo-pink.css";
Nasiruddin Saiyed
  • 1,438
  • 1
  • 13
  • 31
  • I followed the doc of material but precisely it doesn't work :/ I have the error described as above – Lud Jul 25 '18 at 11:38