I\'m starting to use angular-cli and I\'ve already read a lot to find an answer about what I want to do...no success, so I came here.
Is there a way to create a componen
Not sure if maybe Alexander Ciesielski's answer was correct at the time of writing, but I can verify that this no longer works. It doesn't matter which directory in the project you run the Angular CLI. If you type
ng g component newComponent
it will generate a component and import it into the app.module.ts file
The only way you can use CLI to automatically import it into another module is by specifying
ng g component moduleName/newComponent
where moduleName is a module you've already defined in your project. If the moduleName doesn't exist, it'll put the component in moduleName/newComponent directory but still import it into app.module