Angular : ng serve 是如何啓動應用的

如何你對Angular文件目錄結構不熟悉,請出門右轉,補補課.

一: 文字說明

  1. 當你在命令行中輸入 ng serve 後
  2. ng 會根據 angular-cli.json 中的 main元素 找到 應用入口文件main.ts
  3. main.ts 再加載 根模塊AppModule
  4. AppModule 啓動Angular模塊(@ngModule)
  5. @ngModule 爲 AppModule 添加元數據,並指定了頂層組件AppComponent
  6. AppComponent 中我們就可以爲所欲爲了

二: 圖解說明

這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章