$npm install -g @angular/cli
$ng new angular --routing --style=sass
$ng g c home
"apps": [
{
"styles": [
"styles.sass"
],
}
"defaults": {
"styleExt": "sass",
"component": {
}
}
I want to sass style in angular, I use angular cli, I try to generate component it returns with style with prefix css. May you help me to fixing that? Thanks in advance for your answer.
Here is my defaults that works :
Otherwise, you can just rename it.
To override the default style, you can use the option
--style [css|scss|sass]
:I just migrated from
@angular/cli@1.0.3
to@angular/cli@1.4.2
and I am facing the same issue. Turns out it's due to a bug introduced in v1.4.1 so we can only wait for a new angular-cli release that will fix this bug. In v1.4.1 also theapps.prefix
is ignored but this was fixed in v1.4.2.In the mean time, the workaround provided by @Derlin can be used.
github issues on this topic:
update:
The issue is fixed in
@angular/cli@1.4.3
. Check this release note.