Skip to content

Router: Erroneously recognizes non-parameter URLs #5848

Closed

Description

@matanlurey
@RouteConfig(const [
  const Route(
      name: 'Planning',
      path: 'planning',
      component: PlanningComponent),
  const Route(
      name: 'Company',
      // This 'details/' is required, otherwise there are conflicts between the
      // routes as 'all' and 'planning' are interpreted as companyId's.
      path: 'details/:companyId/...',
      component: CompanyComponent)
])

Ideally I'd like to remove details/ from the URL. Right now though planning is interpreted as a :companyId and fails, requiring me to add a prefix.

Activity

  1. btford commented on Dec 16, 2015

    @btford
    Contributor

    So with this configuration (but with /:companyId/... instead of /details/:companyId/...), you navigate to a URL like /planning, and rather than navigate to PlanningComponent, it's navigating to CompanyComponent ?

    What does the RouteConfig for CompanyComponent look like? Specifically, does it include a route with path: '/'?

    I have a hunch why you might be seeing this, but want to double check to be sure.

  2. self-assigned this
    on Dec 16, 2015
  3. btford commented on Dec 16, 2015

    @btford
    Contributor

    I have a reproduction for the case I describe above, but I want to make sure that if this is a problem in some other configuration that I include a test for it as well.

  4. btford commented on Dec 16, 2015

    @btford
    Contributor

    Just chatted with @matanlurey, and the same is true of routes with useAsDefault.

  5. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions