generate module
Command
ng generate module
ng generate m
Creates a new, generic NgModule definition in the given project.
Arguments
name
The name of the NgModule.
Value Type
string
Options
flat
Create the new files at the top level of the current project root.
Value Type
boolean
Defaultfalse
module
Alias
m
The declaring NgModule.
Value Type
string
project
The name of the project.
Value Type
string
route
The 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
string
routing
Create a routing module.
Value Type
boolean
Defaultfalse
routing-scope
The scope for the new routing module.
Value Type
string
DefaultChild
type-separator
The 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
string
Default-
Jump to details