## 創建組件 1. 定義`hello.component.ts`組件 2. 在`app.module.ts`中引用並添加到`declarations`聲明中 3. 在`app.component.html`中使用組件`
命令創建
- 安裝
Angular 5 Snippets,輸入命令ng-component自動生成組件結構 - 使用ng命令自動創建模塊:
ng generate component component-name - 組件會自動加入到
declarations聲明中
## 創建組件 1. 定義`hello.component.ts`組件 2. 在`app.module.ts`中引用並添加到`declarations`聲明中 3. 在`app.component.html`中使用組件`
Angular 5 Snippets,輸入命令ng-component自動生成組件結構ng generate component component-namedeclarations聲明中
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。