angular create component in folder code example
Example 1: generate component angular without folder
Angular:
Add --flat flag.
ng g c yourcomponentname --flat
--flat=true|false
When true, creates the new files at the top level of the current project.
Default: false
Example 2: ng generate component
ng g component [component name]
Example 3: create angular component using cli
ng generate component hero-detail