Skip to content

Expose strategies that correspond to string values of runGuardsAndResolvers #53946

Open

Description

@Erbenos

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

router

Description

Given that runGuardsAndResolvers may take a custom strategy in form of a function, it makes sense to expose the set of predefined strategies 'pathParamsChange' | 'pathParamsOrQueryParamsChange' | 'paramsChange' | 'paramsOrQueryParamsChange' | 'always' so that consumers can compose with them, as was done in case of defaultUrlMatcher, see #35928. Also related #31843 (comment)

Proposed solution

Make the strategies part of public api:

import { RunGuardsAndResolversStrategies } from '@angular/router';

Being:

class RunGuardsAndResolversStrategies {
   static pathParamsChange() { ... }
   static pathParamsOrQueryParamsChange() { ... }
   static paramsChange() { ... }
   static paramsOrQueryParamsChange() { ... }
   static always() { ... }
}

Alternatives considered

Copy paste the code from Angular source code or reimplement said strategies.

Activity

  1. added
    feature
    on Jan 16, 2024
  2. modified the milestone: Backlog on Jan 16, 2024
  3. angular-robot commented on Jan 17, 2024

    @angular-robot
    Contributor

    This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

    You can find more details about the feature request process in our documentation.

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

    area: routerfeature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions