Create nested Component Angular 6
Source copied from the official angular-cli doc
ng generate component my-new-component
ng g component my-new-component // using the alias
// components support relative path generation
// if in the directory src/app/feature/ and you run
ng g component new-cmp
// your component will be generated in src/app/feature/new-cmp
// but if you were to run
ng g component ./newer-cmp
// your component will be generated in src/app/newer-cmp
// if in the directory src/app you can also run
ng g component feature/new-cmp
// and your component will be generated in src/app/feature/new-cmp
Go to the root directory where angular-cli is there
and give the command as follows
c :/users/admin/project/test/src/app/content > ng g c product/advisory
C:\depot\sandbox>ng g c outside
CREATE src/app/outside/outside.component.html (22 bytes)
CREATE src/app/outside/outside.component.spec.ts (635 bytes)
CREATE src/app/outside/outside.component.ts (274 bytes)
CREATE src/app/outside/outside.component.scss (0 bytes)
UPDATE src/app/app.module.ts (546 bytes)
C:\depot\sandbox>ng g c outside/inside
CREATE src/app/outside/inside/inside.component.html (21 bytes)
CREATE src/app/outside/inside/inside.component.spec.ts (628 bytes)
CREATE src/app/outside/inside/inside.component.ts (270 bytes)
CREATE src/app/outside/inside/inside.component.scss (0 bytes)
UPDATE src/app/app.module.ts (636 bytes)
C:\depot\sandbox>ng g c outside/inside-too
CREATE src/app/outside/inside-too/inside-too.component.html (25 bytes)
CREATE src/app/outside/inside-too/inside-too.component.spec.ts (650 bytes)
CREATE src/app/outside/inside-too/inside-too.component.ts (285 bytes)
CREATE src/app/outside/inside-too/inside-too.component.scss (0 bytes)
UPDATE src/app/app.module.ts (740 bytes)
Example taken from angular bug tracker on github.