When you are creating your project with angular cli try this:
ng new My_New_Project --style=sass
This generating all your components with predifined sass files.
If you want scss syntax create your project with :
ng new My_New_Project --style=scss
Cli handles the rest of it.
Angular-cli also adds an option to change the default css preprocessor after the project has been created by using the command:
ng set defaults.styleExt scss
which was fixed by changing the lines ofangular-cli.json,
"styles": [
"styles.css"
],
to
"styles": [
"styles.sass"
],
网友评论