Angular Cli
安裝
前置:安裝Node.js
1.以系統管理員身分執行命令提示字元(cmd)
2.在cmd中輸入指令安裝Angular CLI:npm install -g @angular/cli
3.在cmd中輸入指令驗證Angular CLI版本:ng -v
常用指令
ng new
- 新增專案:
ng new [專案名稱]
- 新增專案:
ng generate (ng g)
- Component(c):
ng g c [名稱]
- Directive(d):
ng g d [名稱]
- Pipe(p):
ng g p [名稱]
- Service(s):
ng g s [名稱]
- Class(cl):
ng g cl [名稱]
- Interface(i):
ng g i [名稱]
- Enum(e):
ng g e [名稱]
- Module(m):
ng g m [名稱]
- Component(c):
ng serve
ng build