Summary
In Angular applications, routes frequently include redirections (redirectTo: 'home', pathMatch: 'full') and route page titles (title: 'Home').
Currently, packages/ng-devtools/src/rpc/get-routes.ts only extracts path, component, and hasChildren. Redirection routes show as having no component (—), making them look like empty or broken routes in both the DevTools UI and the MCP ng-devtools:get-routes agent tool.
Proposed Solution
- Extend
RouteSchema in packages/ng-devtools/src/rpc/get-routes.ts:
- Add optional fields:
redirectTo?: string, title?: string.
- Extract Properties:
- Parse
redirectTo and title literals in findRouteFiles().
- Route Inspector UI:
- Display redirect targets (e.g.
➜ /dashboard) and page titles in app/src/pages/route-inspector.ts.
- Tests:
- Add test cases in
packages/ng-devtools/src/rpc/__tests__/get-routes.test.ts.
Affected Files
packages/ng-devtools/src/rpc/get-routes.ts
app/src/pages/route-inspector.ts
packages/ng-devtools/src/rpc/__tests__/get-routes.test.ts
Summary
In Angular applications, routes frequently include redirections (
redirectTo: 'home', pathMatch: 'full') and route page titles (title: 'Home').Currently,
packages/ng-devtools/src/rpc/get-routes.tsonly extractspath,component, andhasChildren. Redirection routes show as having no component (—), making them look like empty or broken routes in both the DevTools UI and the MCPng-devtools:get-routesagent tool.Proposed Solution
RouteSchemainpackages/ng-devtools/src/rpc/get-routes.ts:redirectTo?: string,title?: string.redirectToandtitleliterals infindRouteFiles().➜ /dashboard) and page titles inapp/src/pages/route-inspector.ts.packages/ng-devtools/src/rpc/__tests__/get-routes.test.ts.Affected Files
packages/ng-devtools/src/rpc/get-routes.tsapp/src/pages/route-inspector.tspackages/ng-devtools/src/rpc/__tests__/get-routes.test.ts