Unless you have recently installed Angular, you need to install it using npm. The part that we are going to install is the Angular CLI. This gives us everything we need to run from Command Prompt to generate our application, add components, scaffold the application, and more:
npm install -g @angular/cli
Creating an application with Angular is easily accomplished using the ng new command, which was added to our system when we added the Angular CLI. We are going to specify command-line arguments to choose SCSS to generate our CSS, as well as choosing the prefix we want to give to any components that we create:
ng new Chapter04 --style scss --prefix atp
We are going to accept the installation defaults, so just press Enter when prompted about whether or not to add Angular routing support. When the installation completes, we are going to start our Angular server, which also watches to see whether files change and rebuilds the application on the fly. Normally, I would install all of the required components before I did this part, but it is useful to see exactly what Angular gives us as a starting point and the ability to view live changes is highly useful:
ng serve --open
Unlike React, the default web address for opening our application is http://localhost:4200. When the browser opens, it displays the default Angular sample page. Obviously, we are going to remove lots from this, but in the short term, we are going to keep this page as it is while we start adding some of the infrastructure we need.
Angular creates a lot of files for us, so it's worth identifying which ones are the ones that we are going to work with the most and what purpose they serve.