Angular使用筆記3_CLI使用_創建並啟動我們第一支AngularApp

 ng version

Outputs Angular CLI version.

ng version [options]
ng v [options]



ng new

Creates a new workspace and an initial Angular application.

ng new <name> [options]
ng n <name> [options]



ng serve

Builds and serves your app, rebuilding on file changes.

ng serve <project> [options]
ng s <project> [options]







ng build

Compiles an Angular app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.

ng build <project> [options]
ng b <project> [options]





Angular CLI 起手式
ng new proj_name --skip-install
cd proj_name
npm install
ng serve



ng new myapp --skip-install









(注意若沒按照順序先把該有的相依套件透過npm install下來會跑出紅色一串錯誤)

而由於我們一開始選擇的是後面多加--skip-install的動作因此之後才有多出這一步驟



等執行完ng serve之後出現上面這種畫面資訊,
打開瀏覽器於網址輸入 localhost:4200 
就可以看到我們自己新建的Angular App






















Ref:
https://angular.io/cli

Could not find module “@angular-devkit/build-angular”
https://stackoverflow.com/questions/50333003/could-not-find-module-angular-devkit-build-angular

解决angular的Cannot find module '@angular-devkit/core'问题
https://blog.csdn.net/u011389297/article/details/80296444












留言

這個網誌中的熱門文章

何謂淨重(Net Weight)、皮重(Tare Weight)與毛重(Gross Weight)

Architecture(架構) 和 Framework(框架) 有何不同?_軟體設計前的事前規劃的藍圖概念

經得起原始碼資安弱點掃描的程式設計習慣培養(五)_Missing HSTS Header