Angular常用命令行和指令
生活随笔
收集整理的這篇文章主要介紹了
Angular常用命令行和指令
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
命令行:
| ng new 包名 | 生成項(xiàng)目包 | ng n 包名 |
| ng serve | 啟動(dòng)項(xiàng)目, 端口號(hào)4200 | ng s |
| ng serve --open | 啟動(dòng)項(xiàng)目 并 在默認(rèn)瀏覽器自動(dòng)打開(kāi) | ng s -o |
| ng generate component 組件名 | 生成組件 | ng g c 組件名 |
| ng generate directive 指令名 | 生成指令 | ng g d 指令名 |
| ng generate pipe 管道名 | 生成管道 | ng g p 管道名 |
指令:
| {{}} | 同 vue, 小程序. 在 html中書(shū)寫(xiě)js 代碼 |
| [innerHTML] | 顯示 html 代碼 |
| *ngFor=“l(fā)et item of items; let i=index” | for循環(huán) |
| *ngIf="" | if判斷 |
| [(ngModel)] | 雙向數(shù)據(jù)綁定 注意事項(xiàng): 必須手動(dòng)掛載 Forms 模塊 |
| [ngStyle]="{樣式名: 值, 樣式名: 值…}" | 動(dòng)態(tài) style |
| [ngClass]="{樣式類(lèi)名: true/false}" | 動(dòng)態(tài) class |
| {{ 值 | 管道名 : 參數(shù) : 參數(shù)… }} | 管道, pipe; 對(duì)應(yīng)vue中的 filter |
總結(jié)
以上是生活随笔為你收集整理的Angular常用命令行和指令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ai钢笔工具怎么描线_骨灰级的AI钢笔工
- 下一篇: configure project qt