如何为具有角度cli的角度组件样式启用SCSS内联模板

前端之家收集整理的这篇文章主要介绍了如何为具有角度cli的角度组件样式启用SCSS内联模板前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Codelyzer test file,我看到SCSS beeing用于样式内联模板.是否可以使用Angular CLI启用它?

我的SCSS设置在使用styleUrls时有效,但不适用于直接样式组件装饰器属性.

更新:

我正在使用Angular CLI 1.0.0和Angular 4.0.1

这是WebStorm IDE中显示错误

error in the WebStorm IDE

解决方法

不幸的是,(此刻)它是不可能的.来自Angular文档:

@H_502_27@

Style strings added to the @Component.styles array must be written in CSS because the CLI cannot apply a preprocessor to inline styles.

https://angular.io/guide/component-styles#non-css-style-files

猜你在找的Angularjs相关文章