Setup Angular 9 Project From Scratch




Step by step explanations:

  1. Prerequisite
  2. Setting up a Angular 9 Project 
  3. Run Application 
  4. Conclusion

1) Prerequisite

  • Setup Node.js & NPM Environment
  • Install Latest Angular CLI Version
  1. npm install -g @angular/cli@latest

2) Setting up a Angular 9 Project

There are some better ways to manage a stylesheet in the angular project. You can set up SCSS, SASS or LESS in our basic Angular project using command line and manually too! Best to decide before going setup project.
  1. ng new angular9-demo
  2. ? Would you like to add Angular routing? No
  3. ? Which stylesheet format would you like to use?
  4. CSS
  5. ❯ SCSS [ https://sass-lang.com/documentation/syntax#scss ]
  6. Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]
  7. Less [ http://lesscss.org ]
  8. Stylus [ http://stylus-lang.com ]

In the terminal you will be asked to install Angular Routing file, this file contains the code for handling the navigation in Angular.

Angular CLI also asks you to choose stylesheet format from Sass, Less, Stylus, SCSS and CSS.
  1. cd angular9-demo

3) Run Application

That's it.
Run the following command in the terminal to start your application:
  1. ng serve

This command start your application on localhost:4200 port.  

Use --open to start your application automatically in browser:

  1. ng serve --open

4) Conclusion

I’ve created this tutorial to speed up our development process. Focusing on Not wasting time on thinking about which framework to use for basic Angular project setup. 

Managing the styles files in a better way.

Thank you for reading.

Post a Comment

0 Comments