Do you need a routing module?
The routing module replaces the routing configuration in the root or function module. Either configure the routes in the routing module, or in the module itself, but not both.
The routing module is the choice of design, the meaning of which is most obvious when the configuration is complex and includes specialized protection and recognition services. This may seem redundant when the actual configuration is dead simple.
Some developers skip the routing module (for example, AppRoutingModule) when the configuration is simple, and merging the routing configuration directly into a companion module (for example, AppModule).
Select one template or another and follow this template in sequence.
Most developers should always implement a routing module for consistency. It keeps the code clean when the configuration becomes complicated. This makes it easy to test the function module. Its existence draws attention to the fact that the module is routed. It is the developers who expect to find and expand the routing configuration.
source share