Skip to content

Method for comparing two URL links #53129

Description

@plohoj

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

router

Description

Nowadays the developer can only compare a link with active routing: Router.isActive(...).
Sometimes developers need to compare a previously visited link or a potential link that the user may visit (after checking) with some constant link.
It would be convenient to have a method of comparing two links.

Proposed solution

Router.isActive(...) already uses the internal containsTree method. It would be convenient to use the containsTree method.
I propose to make the export of the containsTree method (or a laconic version of it) publicly available.

Alternatives considered

Nowadays developers have to write heavy custom methods to compare two references (with possible errors/bugs). This is duplication of code that is already in Angular code

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routerfeatureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions