Skip to content

Allow Resolve implementations to return RedirectCommand #57131

Description

@KraftyKaleb

Which @angular/* package(s) are relevant/related to the feature request?

router

Description

In angular 18, class-based route resolvers were de-deprecated. In addition, we are now able to return a RedirectCommand from route resolvers. However, it seems like this feature was not carried over to class-based route resolvers.

https://angular.dev/api/router/Resolve should have the same features as https://angular.dev/api/router/ResolveFn

Proposed solution

Allow resolve() function on Resolve interface to return T | RedirectCommand instead of just T (Clone of ResolveFn)

Alternatives considered

Remove RedirectCommand from resolvers all together? It's confusing that you can only redirect from certain types of resolvers

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

    P4A relatively minor issue that is not relevant to core functionsarea: routerbreaking changes

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions