► 安裝與更新
► 建立專案
► 啟動
► 常用
► 將 sacc or scss 設為預設的 style檔案類型
► 專案模板所在路徑, 可修改相關檔案來建立專案的初始內容
參考 https://www.npmjs.com/package/angular-cli
npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli
npm cache clean --force
npm install -g @angular/cli
► 建立專案
ng new projectName --skip-tests --skip-git --routing --style=sass [--skip-install]
► 啟動
ng serve [--host 0.0.0.0 --port 4200] [--live-reload-port 49153]
► 常用
-----------------------------------------------
Scaffold Usage
-----------------------------------------------
Component ng g component my-new-component
Directive ng g directive my-new-directive
Pipe ng g pipe my-new-pipe
Service ng g service my-new-service
Class ng g class my-new-class
Interface ng g interface my-new-interface
Enum ng g enum my-new-enum
Module ng g module my-module
-----------------------------------------------
Scaffold Usage
-----------------------------------------------
Component ng g component my-new-component
Directive ng g directive my-new-directive
Pipe ng g pipe my-new-pipe
Service ng g service my-new-service
Class ng g class my-new-class
Interface ng g interface my-new-interface
Enum ng g enum my-new-enum
Module ng g module my-module
-----------------------------------------------
► 將 sacc or scss 設為預設的 style檔案類型
ng set [--global] defaults.styleExt sass
► 專案模板所在路徑, 可修改相關檔案來建立專案的初始內容
...\node_modules\@angular\cli\node_modules\@schematics\angular\application\files
參考 https://www.npmjs.com/package/angular-cli