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 :
- npm install -g @angular/cli
- ng new project name ( ex: ng new myproject)
- cd project name ( ex: cd myproject)
- 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
- ng build –target=production –environment=prod
- ng build –prod –env=prod
- ng build –prod
- ng build –target=development –environment=dev
- ng build –dev –e=dev
- ng build –dev
- ng build
Leave a Reply