Below are some of the important and useful Angular CLI commands that are useful while developing an Angular Application.
To install Angular CLI
npm install -g @angular/cliTo get online help
ng helpTo get detailed help of a command
ng [command name] --helpTo get Angular version details
ng version
or
ng --version
Read:- Angular Interview Questions
To create new Angular Project
ng new <ProjectName>To Build Angular Application
ng buildTo build Angular Project and starts a web server
ng serveTo build and open Angular application in browser
ng serve --open
or
ng serve --oTo run an Angular App on a new port
ng serve --o --port <PortNumber>To generate a production build
ng build --prodTo generate a new component
ng generate component <ComponentName>
or
ng g c <ComponentName>To create a service
ng generate service <ServiceName>
or
ng g s <ServiceName>You may like other blogs –
MVC Tutorial
Web API Tutorial
Building Blocks of Angular
Learn TypeScript
Interview Questions and Answers Series –
MVC Interview Questions and Answers
Web API interview questions and answers
Prev – Angular Versions
Next – How to pass Data from one Component to Other Component in Angular?