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
I didn't find an answer that showed how to use the cli to generate a component inside a top level module folder, and also have the component automatically added the the module's declaration collection.
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:
--EDIT the new version of the angular cli behaves differently. 1.5.5 doesn't want a module file name so the command with v1.5.5 should be
ng g component foo/fooList --module=foo