CLI

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 Typestring

Options

flat

Create the new files at the top level of the current project root.

Value TypebooleanDefaultfalse
module
Aliasm

The declaring NgModule.

Value Typestring
project

The name of the project.

Value Typestring
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 Typestring
routing

Create a routing module.

Value TypebooleanDefaultfalse
routing-scope

The scope for the new routing module.

Value TypestringDefaultChild
Jump to details