Skip to content

Setting named outlet to null with router does not work聽#35732

Closed

Description

@olfek

馃悶 bug report

Affected Package

One of these (extracted from package.json):

"dependencies": {
  "@angular/animations": "~8.2.14",
  "@angular/common": "~8.2.14",
  "@angular/compiler": "~8.2.14",
  "@angular/core": "~8.2.14",
  "@angular/forms": "~8.2.14",
  "@angular/platform-browser": "~8.2.14",
  "@angular/platform-browser-dynamic": "~8.2.14",
  "@angular/router": "~8.2.14",
  "rxjs": "~6.4.0",
  "tslib": "^1.10.0",
  "zone.js": "~0.9.1"
},

Is this a regression?

Don't know, I have not used this feature before.

Description

this.router.navigate([{ outlets: { popup: null }}]); as mentioned here does not work.

馃敩 Minimal Reproduction

I have attached a zip file. named-outlet-router-bug.zip

馃敟 Exception or Error

None.

馃實 Your Environment

Angular Version:

Angular CLI: 8.3.25
Node: 12.14.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.25
@angular-devkit/build-angular     0.803.25
@angular-devkit/build-optimizer   0.803.25
@angular-devkit/build-webpack     0.803.25
@angular-devkit/core              8.3.25
@angular-devkit/schematics        8.3.25
@angular/cli                      8.3.25
@ngtools/webpack                  8.3.25
@schematics/angular               8.3.25
@schematics/update                0.803.25
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant?
No.

Activity

  1. atscott commented on Feb 27, 2020

    @atscott
    Contributor

    Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

    If the problem still exists in your application, please open a new issue and follow the instructions in the issue template, including a minimal reproduction in either Stackblitz or a minimal GitHub repo.

  2. olfek commented on Feb 27, 2020

    @olfek
    Author

    Hello, please re-open this issue, I have already attached a zip file of an Angular app which reproduces the problem and I also explained what the problem was in the 'description' section.

  3. olfek commented on Feb 27, 2020

    @olfek
    Author

    @atscott If you download the zip file and run the app, you'll be able to see the problem in action.

  4. olfek commented on Feb 29, 2020

    @olfek
    Author

    @atscott This might be an actual bug, and you are ignoring it. For someone in your position, shame on you. For any projects in the future, I will consider using Vue.js instead. 馃槨

  5. olfek commented on Feb 29, 2020

    @olfek
    Author

    Since reporting this, I have also discovered another bug just now which seems to be affecting ~320k people. Someone may have already reported this, but the issue was probably closed just like this one without any second thought by some snobby individual.

  6. olfek commented on Feb 29, 2020

    @olfek
    Author

    @atscott See the bug in action below.

    tmp

  7. IgorMinar commented on Feb 29, 2020

    @IgorMinar
    Contributor

    @olfek first of all, I understand that you are frustrated, but let me please remind you of our code of conduct (https://github.com/angular/code-of-conduct). We will not tolerate any further threats or personal attacks against out team members or community members.

    I'm reopening the issue since you provided additional info. We however need more. Can you please add a textual description of:

    1. Repro steps using your attached app
    2. Expected behavior
    3. Actual behavior
  8. added this to the needsTriage milestone on Feb 29, 2020
  9. olfek commented on Feb 29, 2020

    @olfek
    Author

    I did not make any threats or carry out any personal attacks, I simply expressed my frustration with the way a new issue was closed immediately without any discussion opportunity. If what I experienced is standard procedure, you are missing out on a lot of valuable real bug reports, I would recommend reviewing your processes and members actions or risk having the community relationship that react native has.

    Anyway, thank you for re-opening the issue, I will address the requested information below.

    1. See the GIF on how to reproduce the bug (the app has been uploaded here, see link above).
    2. The second button, which uses this.router.navigate([{ outlets: { popup: null }}]); should have the same/similar behavior as the first button routerLink="..".
    3. The second button does not work.
  10. 1 remaining item

  11. modified the milestones: Backlog, needsTriage on Mar 2, 2020
  12. olfek commented on Mar 26, 2020

    @olfek
    Author

    Just now, I needed to use this (programmatic navigation to named outlet) again, I have discovered that not only does setting it to null not work, setting it to an actual path doesn't work either.

  13. gunsh commented on Apr 24, 2020

    @gunsh

    I found an ugly but effective workaround. This is a demo that demonstrate this issue as I have seen it: https://stackblitz.com/edit/angular-spzbc3

    There is a difference between trying to navigate to 'null' from within the component that is active in the secondary outlet and doing the same thing outside of it. The latter just works. So the workaround is to host a hidden <a [routerLink]> outside of the secondary outlet and to have a service click it programmatically. Another way is to just call 'router.navigate()' but that simply didn't work for me.

    I hope this saves someone some precious time.

  14. atscott commented on May 26, 2020

    @atscott
    Contributor

    Related issue: #13523

  15. atscott commented on May 26, 2020

    @atscott
    Contributor

    Closing as duplicate of #15718. Example from this issue also copied to stackblitz and included here: #15718 (comment)

  16. angular-automatic-lock-bot commented on Jun 27, 2020

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

  17. locked and limited conversation to collaborators on Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions