- Angular UI Development with PrimeNG
- Sudheer Jonna Oleg Varaksin
- 113字
- 2021-07-15 17:32:59
Generating scaffolding
Angular CLI allows us to generate components, services, directives, routes, pipes, and many more with ng generate. Here is how you would generate a component:
ng generate component path/name
For example, if we run the following command:
ng generate component shared/message
Four files will be generated and one updated. The produced output will be:
installing component
create src/app/shared/message/message.component.scss
create src/app/shared/message/message.component.html
create src/app/shared/message/message.component.spec.ts
create src/app/shared/message/message.component.ts
update src/app/app.module.ts
The new component is registered in app.module.ts automatically. The generation of other scaffoldings is identical. For example, to generate a service, run this command:
ng generate service path/name
There are plenty of useful options. You can set, for example, --spec=false to skip test file generation.
推薦閱讀
- Software Defined Networking with OpenFlow
- 兩周自制腳本語(yǔ)言
- 小創(chuàng)客玩轉(zhuǎn)圖形化編程
- Java從入門到精通(第4版)
- Python網(wǎng)絡(luò)爬蟲(chóng)從入門到實(shí)踐(第2版)
- AIRAndroid應(yīng)用開(kāi)發(fā)實(shí)戰(zhàn)
- 教孩子學(xué)編程:C++入門圖解
- Mastering Apache Maven 3
- Learning jQuery(Fourth Edition)
- Python商務(wù)數(shù)據(jù)分析(微課版)
- ActionScript 3.0從入門到精通(視頻實(shí)戰(zhàn)版)
- IPython Interactive Computing and Visualization Cookbook
- WordPress Search Engine Optimization(Second Edition)
- SQL Server 2012 數(shù)據(jù)庫(kù)應(yīng)用教程(第3版)
- Spring Boot 3:入門與應(yīng)用實(shí)戰(zhàn)