-
Notifications
You must be signed in to change notification settings - Fork 12k
ng g module my-module only generates the module.ts file #6844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As per issue #3365 and PR #3389 this has changed to have only module generated by default. But with the --routing flag it should generate the component as per generate-module.spec.js
and e2e/tests/generate/module/module-routing.ts I have tried it and generate is not creating the component or the spec with --routing flag. I am not sure if I am missing something or if this is a regression. Doc's say nothing about the routing flag though. Module not provided is just a warning. You can specify --module=, eg: --module=app to import the newly created module to an existing module to get rid of those warning. |
Since new version is out: |
video is from Oct 5, 2016 First stable release Mar 24 2017: https://github.com/angular/angular-cli/releases/tag/v1.0.0 Please refer to the docs: https://github.com/angular/angular-cli/wiki |
Yep it is :smiley. I'm the author of the screencast and I created it now nearly 10 months ago. While the shown Angular techniques are still valid, the CLI has changed its behavior in some cases such as in this one. So while before it generated the module and some sample components as well, now you have to do it separately in two steps:
and then generate the component
which generates a Also take a look at the docs, they're quite good now: Hope that helps, otherwise simply ping me again if you have any further questions 😉 |
Can confirm in 1.2.0, ng generate module --routing not creating component.
Can someone please confirm, if --routing flag can be used to create module along with component? |
Yeah my bad, I interpreted it wrong. It create only route with that flag. |
@vlrprbttst I think this issue can be closed, right? //cc @rageshvr |
Hi there!! If module->properties->spec->default(find in below code) is false, it only generates module.ts. By default, it is false. If you want to generate module.spec.ts file, change it to true.. "module": |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
i'm just starting with angular and i was following a beginner screencast tutorial.
when the guy creates a new module: https://youtu.be/fXHyqSIIF9Q?t=14m10s angular-cli spits css/html/component files as you can see, but on my local environment all i get is the xxx.module.ts file. and this warning:
WARNING Module is generated but not provided, it must be provided to be used
is there something wrong or is it an old screencast?
sorry for the very noob question. just moving my very first steps here
The text was updated successfully, but these errors were encountered: