question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot remove outlets from path

See original GitHub issue

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

It seems impossible to navigate to some path and clear any named outlets in the process. Consider this code:

this.router.navigate(['/', { outlets: { secondary: null } });

This does not remove the (secondary:) portion from the path. However this code does remove that segment:

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

In addition this.router.navigateByUrl('/') also works.

Expected behavior

The first code should also work and remove the secondary outlet segment from the path.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/hFsOdLLr2LCq8cJyOF6R?p=preview

What is the motivation / use case for changing the behavior?

The current behavior looks erroneous. I believe there should be an else here which sets children[outlet] to null so it is not initialized later.

Please tell us about your environment:

  • Angular version: 2.4.10

Code in master looks the same as in 2.4.10.

  • 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 browsers.

  • Language: [all | TypeScript X.X | ES6/7 | ES5] I think it is a framework issue rather than a language one.
  • Node (for AoT issues): node --version =

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:44
  • Comments:30 (3 by maintainers)

github_iconTop GitHub Comments

20reactions
orestisioakeimidiscommented, Apr 3, 2017

It would be nice to use it with the routerLink directive as well.

<a [routerLink]="['/', { outlets: { secondary: null } }]">Back</a>

Thanks!

13reactions
akorchevcommented, Oct 12, 2017

FWIW I am using the following as a workaround:

this.router.navigate([{ outlets: { secondary: null } }])
           .then(() => this.router.navigate(['/']));
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I remove a receptacle and abandon the electrical ...
Unscrew the hots, neutrals, and ground from the outlet and remove the outlet; Splice the hot, neutral, and ground from both sides (charge...
Read more >
Angular 5 how to remove auxilary route outlet name in URL ...
1 Answer 1 · 2. This doesn't seem to work from within a component in the auxiliary outlet... so a modal popup cannot...
Read more >
How To: Fix Ungrounded Outlets - The Craftsman Blog
The ideal way to repair an ungrounded 3-prong outlet is to establish a continuous electrical path back to the main panel. If the...
Read more >
Route - Angular
The router attempts to match segments of a given URL against each route, ... Cannot be used together with a custom matcher function....
Read more >
Electrical Safety - Occupational Safety and Health Administration
The 3-conductor plug on the tool must be plugged into a grounded outlet. ... A ground fault occurs when electrical current flows on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found