generate module
Command
ng generate moduleng generate mCreates a new, generic NgModule definition in the given project.
Arguments
nameThe name of the NgModule.
Value Type
stringOptions
flatCreate the new files at the top level of the current project root.
Value Type
booleanDefaultfalsemoduleAlias
mThe declaring NgModule.
Value Type
stringprojectThe name of the project.
Value Type
stringrouteThe route path for a lazy-loaded module. When supplied, creates a component in the new module, and adds the route to that component in the Routes array declared in the module provided in the --module option.
Value Type
stringroutingCreate a routing module.
Value Type
booleanDefaultfalserouting-scopeThe scope for the new routing module.
Value Type
stringAllowed ValuesChild, RootDefaultChildtype-separatorThe separator character to use before the type within the generated file's name. For example, if you set the option to ., the file will be named example.module.ts.
Value Type
stringAllowed Values-, .Default-Jump to details