如何在@component之前将scss导入Angular2

时间:2017-02-27 17:46:26

标签: angular sass

我按照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 {
}

但是,我有两个问题:

  1. 为什么在styles.scss之前导入@Component,差异是什么 嵌入styleUrls
  2. import '../../public/css/styles.scss';不起作用

0 个答案:

没有答案