How to create component to specific module with Angular-CLI

3.4K    Asked by Aryangupta in Python , Asked on Jan 11, 2020
Answered by Arun Singh

To create the module run this:

ng g module foo

To create the component inside the foo module folder and have it added to the foo.module.ts's declaration collection run this:

ng g component foo/fooList --module=foo.module.ts

And the cli will scaffold out the module and component like this:



Your Answer

Interviews

Parent Categories