Skip to content
Birendra Rajput edited this page Jul 5, 2019 · 6 revisions

Angular CLI

Overview

The Angular CLI(command-line interface) is a tool to initialize, develop, scaffold and maintain Angular applications.

To install the Angular CLI:

 npm install -g @angular/cli

Create and run a new project:

 ng new my-project
 cd my-project
 ng serve
 ng serve --open
 Control+C then after Y to stop processing

Running unit tests:

 ng test

Running end-to-end tests:

 ng e2e

Generate component:

ng generate component [name]
c - ng generate c [name]

Generate module:

ng generate module [name]
m - ng generate m 

Generate service:

ng generate service [name]
s - ng generate s [name]

Generate class:

ng generate class [name]
cl - ng generate cl [name]

Generate directive:

ng generate directive [name]
d - ng generate d [name]
Clone this wiki locally