- 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.
推薦閱讀
- Learning C# by Developing Games with Unity 2020
- 微服務與事件驅動架構
- Learning Spring 5.0
- HTML5游戲開發案例教程
- Learning Network Forensics
- JavaScript:Moving to ES2015
- 精通Python設計模式(第2版)
- RabbitMQ Cookbook
- NetBeans IDE 8 Cookbook
- Mastering Backbone.js
- Mastering Gephi Network Visualization
- Python Deep Learning
- 少兒編程輕松學(全2冊)
- RabbitMQ Essentials
- Elasticsearch源碼解析與優化實戰