我按照https://github.com/AngularClass/angular2-webpack-starter/wiki/How-to-include-SCSS-in-components使scss适用于angualr2,其中大多数都很好。
import {Component} from '@angular/core';
import {ViewEncapsulation} from '@angular/core';
import '../../public/css/styles.scss'; // this file is not imported
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
encapsulation: ViewEncapsulation.None,
styleUrls: ['./app.component.scss']
})
export class AppComponent {
}
但是,我有两个问题:
styles.scss
之前导入@Component
,差异是什么
嵌入styleUrls
import '../../public/css/styles.scss';
不起作用