Skip to content

Router navigate on page refresh #5526

@tbragaf

Description

@tbragaf

Hi all!

I came across a weird behaviour with router navigation with child routers.

Parent Router:

@RouteConfig([
  { path: 'child/...', as: 'Child', component: Child }
])

Child Router:

@RouteConfig([
  { path: '/', redirectTo: '/favorites' },
  { path: ':category', as: 'Category', component: Category }
])

If I use the router navigation API, this navigation seems not to be working:

this.router.navigate('child');

Neither does refresh the page work (refresh with '#/child' does not even instanciate the Child router).

Child Router redirect seems to be only working with Router Link:

<a [router-link]="['Child']">Home</a>

Is it possible this is occuring since the url does not match the pattern '/...' ?

Can anyone confirm this?

Best regards,
tbragaf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions