Angular CLI Cheatsheet

?
R
Bash

Most common angular-cli tooling commands. Updated to version 6 of Angular CLI.

1# Latest Version:
2Angular CLI: 6.0.8, Node: 8.9.4, Angular: 5.2.11
3
4# Create a Module with Routing
5ng g m grid --route grid --module app.module
6
7# Installation
8npm install -g @angular/cli
9ng new my-dream-app
10cd my-dream-app
11ng serve
12
13### Warning ###: Please cd into src/app before running `ng g * *` commands.
14cd client/src/app
15
16# Components Generation
17ng generate  name
18ng generate component test //note: Angular CLI automatically suffixes components with 'Component'    
19ng generate directive test
20ng generate router test
21ng generate pipe test
22ng generate service test
23ng generate class test
24ng generate interface test
25ng generate enum test
26
27# Build
28ng build --prod
29cd dist
30http-server -p 8080

Created on 6/11/2017