By default, if we run
ng new project-name
using terminal/cmd, the angular framework will be installed without enabling CSS Preprocessors in angular. To overcome this, follow the simple procedure shared belowScenario 1: ( Enabling SASS/SCSS in existing Angular project )
Using Angular-CLI
ng config schematics.@schematics/angular:component.styleext scss
Manually
- Open angular.json file
- Find "schematics": {}
- Add
"@schematics/angular:component": { "styleext": "scss" }
After enabling CSS Preprocessor, just do following steps
- Update all .css files to .scss (style.css in src folder and all custom generated components etc..)
- Open angular.json file
- Update all
"src/styles.css"
to"src/styles.scss"
Stop the server and restart.. All set to go with SCSS.
Scenario 2: ( Enabling SASS/SCSS in new Angular project )
Using Angular-CLI
Add
--style=sass
with the command to create new angular project
ng new project-name --style=sass
ReplyDeleteAfter reading this blog i very strong in this topics and this blog really helpful to all...AngularJS Online Course Bnagalore
Great Article
DeleteAngular Final Year Project Ideas for Computer Science
Project Centers in Chennai