简体   繁体   English

Angular 2中的Angular Material Theme导入在Webstorm中不起作用

[英]Angular Material Theme import in Angular 2 not working in Webstorm

I am trying to import the built in themes of angular material 2 but web-storm is unable to the resolve the file path and find directory although my theme file is residing in that exact directory. 我正在尝试导入角度材质2的内置主题,但是web-storm无法解析文件路径并找到目录,尽管我的主题文件位于该确切目录中。 i have tried different methods to import but all resulted in same issue. 我尝试了不同的导入方法,但是都导致了相同的问题。 Here is how i am importing in my styles.scss file 这是我在styles.scss文件中导入的方式

@import '~@angular/material/prebuilt-themes/indigo-pink.css';

The IDE starts highlighting the path from material stating the problem. IDE将启动从突出说明材料问题的路径。

This is the whole path of my theme file. 这是我的主题文件的整个路径。

/media/rehan/New Volume/tic-tac-toe/node_modules/@angular/material/prebuilt-themes/indigo-pink.css

由于我正在使用Angle 2中的基于Angular CLI的项目,因此我仅使用以下路径将主题文件添加到styles对象下的.angular-cli.json文件中,该路径可能会随角度材料的安装位置而有所不同:

 "styles": [ "../node_modules/@angular/material/prebuilt-themes/indigo-pi‌​nk.css"]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM