Skip to content

feat(routes): parse and display redirectTo, title, and route metadata in Route Inspector #9

Description

@Kaap10

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

  1. Extend RouteSchema in packages/ng-devtools/src/rpc/get-routes.ts:
    • Add optional fields: redirectTo?: string, title?: string.
  2. Extract Properties:
    • Parse redirectTo and title literals in findRouteFiles().
  3. Route Inspector UI:
    • Display redirect targets (e.g. ➜ /dashboard) and page titles in app/src/pages/route-inspector.ts.
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions