- 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.
推薦閱讀
- Flask Blueprints
- C# 2012程序設計實踐教程 (清華電腦學堂)
- C# Programming Cookbook
- Django:Web Development with Python
- 計算機應用基礎實踐教程
- 圖數據庫實戰
- Natural Language Processing with Java and LingPipe Cookbook
- R語言:邁向大數據之路(加強版)
- 實戰Java高并發程序設計(第2版)
- Android高級開發實戰:UI、NDK與安全
- 趣學數據結構
- JavaScript高級程序設計(第4版)
- C語言從入門到精通(第5版)
- Real-time Analytics with Storm and Cassandra
- Python語言及其應用(第2版)