Angular CLI

By | 07/08/2019

Angular CLI is a command line tool for creating Angular application.
It avoids to spend time for installing, configuring all the required dependencies and wiring everything together.
Angular CLI is available for many platforms such as Windows, Mac and Linux and, in order to install it, we have to install node.js before.
After Node installation, using the command npm install -g @angular/cli, we will install Angular CLI.
To verify the correct installation, we can use the command ng –version.

Now, we will create our first Angular application called ApplicationTest, using Angular CLI.
First of all, create a folder called dev_angular and, from the Command Prompt, run the command
ng new ApplicationTest

The application has been created and using an IDE, for example Visual Studio Code, we can see the files in the project:

With the command ng serve, we run locally the application:

and, if we open a browser and go to http://localhost:4200, this will be the output:



Leave a Reply

Your email address will not be published. Required fields are marked *