how to create a basic angular 9 app with Angular CLI


Here is how to create a simple Angular 9 application with the Angular CLI in Windows 10.

Step 1 - install Angular CLI

In a command prompt navigate to the folder where you want to create your new app. Then type :

npm install -g @angular/cli

Check that your version of Angular CLI is up to date by comparing the version on the Angular.io website and typing :

ng --version

If it isn't showing the latest version you should:

npm uninstall @angular/cli

npm install -g @angular/cli@latest

Step 2 - create the App

In your command prompt type:

  • ng new example (example is the name I am using for the app)
  • y when the command prompt asks "would you like to add Angular routing?"
  • navigate to the format you prefer using the up and down arrows and hit enter when the command prompt asks "Which stylesheet format would you like to use?" I always use SCSS

After the installation process has finished type :

cd example

Step 3 - run your app

In your command prompt type :

ng serve

Open a new browser windows and navigate to http://localhost:4200 and you should see the following standard Angular welcome page :

You now have a working Angular 9 app.

Next - add some more components and Angular Routing

Latest posts