Skip to content

Router 3.2.0 - child routes not loading when parent route has empty path #12976

Closed

Description

@Cammisuli

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting

Current behavior
Setting up routes that have empty paths do not load any child routes.

Expected behavior
I expect the routes to work the same as it did with [email protected]

Minimal reproduction of the problem with instructions
Here's a reproduction with version 2.1.2 of angular/core and 3.1.2 of angular/router:
http://plnkr.co/edit/v8q3RQp4rdbVtmklCq6W?p=preview
Notice that the child route appears, and you are able to click the button that shows.

Here's a reproduction with the latest version of angular and the router:
http://plnkr.co/edit/KCxtwpls3LwMPFxlRa5P?p=preview
Here, the child route does not load.

What is the motivation / use case for changing the behavior?
I expected that a minor upgrade to angular would not cause a breaking change like this.

Please tell us about your environment:
Windows 10

  • Angular version: 2.2.0

  • Browser: All

  • Language: Typescript 2

  • Node (for AoT issues): node --version = v5.10.1

Activity

  1. grahamford commented on Dec 29, 2016

    @grahamford

    I've been going back trying different versions of the router and to me it looks as though this bug was introduced in version 3.3.0.
    I couldn't figure out which of the changes introduced the unintended behaviour though.

  2. vicb commented on Dec 29, 2016

    @vicb
    Contributor

    The plunker seems to work fine on Chrome.
    What browser do not work ?

  3. Cammisuli commented on Dec 29, 2016

    @Cammisuli
    Author

    @vicb sorry, I forgot to mention that I found a workaround for the latest version. I reverted the broken plunk to before the workaround.
    http://plnkr.co/edit/KCxtwpls3LwMPFxlRa5P?p=preview

  4. DzmitryShylovich commented on Dec 29, 2016

    @DzmitryShylovich
    Contributor

    @Cammisuli what was the workaround? :)

  5. Cammisuli commented on Dec 29, 2016

    @Cammisuli
    Author

    @DzmitryShylovich
    Looking at the broken plunk, i moved the redirect route:

    {
        path: '',
        redirectTo: '/child',
        pathMatch: 'full'
    }
    

    from src/app.ts to src/main/main-view.ts. Doing that allowed the routes to properly work.

  6. added this to the Backlog milestone on Jan 23, 2018
  7. added
    P3
    and removed on Oct 1, 2020
  8. angular-automatic-lock-bot commented on Dec 17, 2021

    @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.

  9. locked and limited conversation to collaborators on Dec 17, 2021
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

    P3area: routerfreq2: mediumrouter: config matching/activation/validationrouter: lazy loadingstate: confirmedtype: bug/fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions