The Angular CLI is a command line interface tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.

The goal in this guide is to build and run a simple Angular application in TypeScript, using the Angular CLI while adhering to the Style Guide recommendations that benefit every Angular project.

Steps of CLI :

  1. npm install -g @angular/cli
  2. ng new project name ( ex: ng new myproject)
  3. cd project name ( ex: cd myproject)
  4. ng serve ( for display output )

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!

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.

Test, Lint, Format

Make your code really shine. Run your unittests or your end-to-end tests with the breeze of a command. Execute the official Angular linter and run clang format.

 

How to Build Your  Project 

  1. ng build –target=production –environment=prod
  2. ng build –prod –env=prod
  3. ng build –prod
  4. ng build –target=development –environment=dev
  5. ng build –dev –e=dev
  6. ng build –dev
  7. ng build

Running unit tests

ng test

Running end-to-end tests

ng e2e