Sharing Top Content from the Angular-sphere.

All You Need To Know About Angular CLI

  • It comes with commands that help us to create and start the Angular project fastly.
  • You can use the given command: – – After the successful installation, Angular CLI is ready for use.
  • In these commands first, we are creating a new angular app using “ng new projectName” command.
  • And using the “ng serve” command to execute the Angular application.
  • You can use the ng generate (or just ng g) command to generate Angular components: – – You can find all possible blueprints in the table below: – – angular-cli will add the reference to components, directives, and pipes automatically in the “app.module.ts”.

In this article, we will discuss the basics of Angular CLI. Angular CLI provides an easy way to start with any Angular project. It comes with commands that help us to create and start the Angular project fastly. Let go through with the available commands. You need to setup the node js and npm to work with the CLI. You can get the node setup here as per your system compatibility.

Let’s confirm the version of node and npm in working or not.

Firstly, we need to install the Angular CLI. You can use the given command:

After the successful installation, Angular CLI is ready for use.

In these commands first, we are creating a new angular app using “ng new projectName” command. Then using the basic “cd projectName” command to enter in the app folder. And using the “ng serve” command to execute the Angular application.

After executing the “ng serve”, NG Live development server is listening on “localhost:4200”.

We can change the port no as per the requirement, using the “–port” with the “ng serve” command.

After executing the “ng serve” NG Live development server is listening on “localhost:90”.

You can use the ng generate (or just ng g) command to generate Angular components:

You can find all possible blueprints in the table below:

angular-cli will add the reference to components, directives, and pipes automatically in the “app.module.ts”.

If you need to…

All You Need To Know About Angular CLI