forked from PatrickJS/angular-webpack-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
How to include SCSS in components
Kuisong Tong edited this page Mar 21, 2016
·
10 revisions
npm install node-sass sass-loader --save-dev
{
test: /\.scss$/,
exclude: /node_modules/,
loaders: ['raw-loader', 'sass-loader'] // sass-loader not scss-loader
}Then in your component:
@Component({
styles: [ require('./filename.scss') ],
})if you want global css support then on the top level component remove encapsulation and include the scss
import {ViewEncapsulation} from 'angular2/core';
@Component({
selector: 'app',
styles: [
require('bootstrap.scss')
],
encapsulation: ViewEncapsulation.None,
template: ``
})
class App {}enjoy — AngularClass
Learn AngularJS, Angular 2, and Modern Web Development from the best. Looking for corporate Angular training, want to host us, or Angular consulting? patrick@angularclass.com
