Promact/md2

Could not find Angular Material core theme. Most Material components may not work as expected

Closed this issue · 4 comments

ph55 commented

Bug:

Warning thrown in console:

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
webpackJsonp.../../../../md2/core/common-behaviors/common-module.js.MdCommonModule._checkTheme @ vendor.bundle.js:57599
MdCommonModule @ vendor.bundle.js:57583
_createClass @ vendor.bundle.js:163965
_createProviderInstance$1 @ vendor.bundle.js:163933
initNgModule @ vendor.bundle.js:163887
NgModuleRef_ @ vendor.bundle.js:164995
createNgModuleRef @ vendor.bundle.js:164979
debugCreateNgModuleRef @ vendor.bundle.js:167263

Which versions of Angular, MD2, OS, browsers are affected?

0.25

I'm pretty sure this doesn't have to do with this repository but the Angular's Material 2. Check out step 4 on that page.

ph55 commented

@EliCDavis
Yes you're right - this warning fixed by installing material2 and including one of it's theme css.
But this is not the point.
If material2 is required - this should be mentioned in docs / setup guide.
Otherwise this warning should be fixed imho.

Hy I got this warning as well..

Why should we do ? import material theming since I dont use it in md2 ?
Can anybody explain about it ?

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";

You can select any css under the prebuilt-themes folder.