简体   繁体   中英

How to build a single component in Angular

I am working on an Angular app. I have completed my work and want to put the app onto the test server. But the requirement is that I just want to build a single component and put it onto the server.

I have tried ng build but it gives me the build of the whole app. But I want the build of just a single component.

I have looked onto the internet but nothing relevant could be found.

Any help is appreciated.

Thanks in advance

ng generate component my-component-name

This is all described in the first pages of their tutorial https://angular.io/tutorial/toh-pt0

Use generate command to generate your component:

ng g c componentName

https://angular.io/cli/generate#component-command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM