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
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
it('ng generate module  generate routing and component files when passed flag --routing', 
function () {}
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=
Since new version is out:
I had verified this in version 1.1.3
is it an old screencast?
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
is it an old screencast?
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:
$ ng g module people
and then generate the component
$ ng g component people/people
which generates a people.component.ts in the module people, therefore the people/people.
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 :wink:
Can confirm in 1.2.0, ng generate module 
@angular/cli: 1.2.0
node: 8.1.3
os: win32 x64
@angular/animations: 4.2.5
@angular/common: 4.2.5
@angular/compiler: 4.2.5
@angular/core: 4.2.5
@angular/forms: 4.2.5
@angular/http: 4.2.5
@angular/platform-browser: 4.2.5
@angular/platform-browser-dynamic: 4.2.5
@angular/router: 4.2.5
@angular/cli: 1.2.0
@angular/compiler-cli: 4.2.5
@angular/language-service: 4.2.5
ng new my-app
cd my-app
ng g m my-module --routing
create src\app\my-module\my-module-routing.module.ts
  create src\app\my-module\my-module.module.ts
  WARNING Module is generated but not provided, it must be provided to be used
Can someone please confirm, if --routing flag can be used to create module along with component?
@rageshvr --routing is for creating routing information. See the docs
Just as a hint, you can also add --dry-run to just check which files would be created by the CLI without any effect on your file system.
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!!
Look at the default settings of module in schema.json(node_modules/@angular/cli/lib/config/schema.json) file. Change as required..
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":
{
          "description": "Options for generating a module.",
          "type": "object",
          "properties":
{
            "flat":
{
              "description": "Flag to indicate if a dir is created.",
              "type": "boolean",
              "default": false
            },
            "spec":
{
              "description": "Specifies if a spec file is generated.",
              "type": "boolean",
              "default": false
            }
          }
        }
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
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
people.component.tsin the modulepeople, therefore thepeople/people.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 :wink: