InterviewHubPRO
Section Overview
Q74

Question 74 of 283

Part 3: Angular Router, Navigation & SSR Universal (63 - 75)

26%
Angular & Signals (283 Qs)•Part 3: Angular Router, Navigation & SSR Universal (63 - 75)

Do I need a Routing Module always?

No, the Routing Module is a design choice. You can skip routing Module (for example, AppRoutingModule) when the configuration is simple and merge the routing configuration directly into the companion module (for example, AppModule). But it is recommended when the configuration is complex and includes specialized guard and resolver services.

Practical Code Example

typescript
// Do you always need a Routing Module?
// NO. Modern Angular uses provideRouter() in app.config.ts without any AppRoutingModule:
// app.config.ts:
export const appConfig: ApplicationConfig = {
  providers: [provideRouter(routes)]
};