1. Generate a routing module while creating a module in angular-cli
To generate a module with routing using angular-cli
use the following command:
or shorter:
This command creates both module.ts
and routing.module.ts
together at the same in the current directory.
2. Generate a routing module with a module in sub-directory:
To create a module in sub-directory use:
or
The sub-folder
will be created if it does not exist.
3. Generate a module, routing for the module and component at one
There is also a way to create modules, routing, and components using single line command:
For example the following command run in src/app/
directory:
will generate autocomplete
module, routing module and component in src/app/pages/autocomplete
folder:
The AutocompleteModule
has AutocompleteComponent
in declarations and AutocompleteRoutingModule
in imports:
The newly generated AutocompleteRoutingModule
is empty:
the same as AutocompleteComponent
:
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}