Setup angular 4  using angular CLI command-line

Setup angular 4 using angular CLI command-line

Step: 1  Download Node js in your system from and Install it,

Node.js is an open-source, cross-platform  JavaScript run-time environment that executes JavaScript code server-side.

Step: 2  Open CMD  command-line in your system and run CLI  command.

Fist CLI command for creating a new  Angular project. 

npm install -g @angular/cli

Generating and serving an Angular project via a development server.

ng new my-new-project
cd my-new-project
ng serve

CMD for angular

Install  Angular use this command.

npm install -g @angular/cli
C:\Users\room>npm install -g @angular/cli


After using this command Angular Setup all config... after success move on your project folder.

C:\Users\room>cd desktop/project

ng new

The Angular CLI makes it easy to create an application that already works, right out of the box. It already follows our best practices!

C:\Users\room\Desktop\project>ng new my-app

ng new my-app

ng generate

Generate components, routes, services and pipes with a simple command. The CLI will also create simple test shells for all of these.

ng serve

Easily test your app locally while developing.

C:\Users\room\Desktop\project\my-app>ng serve

Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

You can configure the default HTTP host and port used by the development server with two command-line options :

ng serve --host --port 4201


Comments / Answer

Leave a comment & ask question