Skip to content

Child aux route cannot be closed by setting outlet to null #15718

@ipassynk

Description

@ipassynk

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

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
I have a child aux route:

const routes = [
  {
    path: 'first', 
    component: FirstComponent, 
    children: [
      {
        path: 'add-groups',
        outlet: 'aside',
        component: AsideComponent
      }
  ]
];

Aux component has a close button that works only when parent's params are set to navigate method like that:

 this.router.navigate([this.route.parent.snapshot.params, {outlets: {aside: null}}]);

and doesn't work like:

 this.router.navigate([{outlets: {aside: null}}]);

Expected behavior
Expect this.router.navigate([{outlets: {aside: null}}]); will close the aux

Minimal reproduction of the problem with instructions
https://plnkr.co/edit/kA434H7u5mJbiB7vvkCQ

What is the motivation / use case for changing the behavior?
Use aux routing

Please tell us about your environment:
Mac OS

  • Angular version: 2.0.X
    2.4.8

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    All

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TypeScript

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions