- 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.
推薦閱讀
- Instant Node Package Manager
- 微服務設(shè)計(第2版)
- GraphQL學習指南
- Learning PostgreSQL
- GeoServer Cookbook
- Big Data Analytics
- Visual Basic程序設(shè)計實踐教程
- 微信小程序全棧開發(fā)技術(shù)與實戰(zhàn)(微課版)
- 新一代SDN:VMware NSX 網(wǎng)絡原理與實踐
- R語言:邁向大數(shù)據(jù)之路(加強版)
- Kotlin極簡教程
- FPGA嵌入式項目開發(fā)實戰(zhàn)
- Visual Basic程序設(shè)計全程指南
- LabVIEW入門與實戰(zhàn)開發(fā)100例(第4版)
- Vue.js 3.x高效前端開發(fā)(視頻教學版)