Skip to content

docs(router): Clarify how to clear secondary routes - #40272

Closed
atscott wants to merge 1 commit into
angular:masterfrom
atscott:closepopup
Closed

atscott wants to merge 1 commit into
angular:masterfrom
atscott:closepopup

Conversation

@atscott

@atscott atscott commented Dec 28, 2020

Copy link
Copy Markdown
Contributor

The example for clearing secondary outlets currently only works because
the named outlet appears at the root of the application's route config.
If developers follow this example with an outlet that is not at the
root level, they will not be able to close the outlet.
This commit updates the example to provide a more robust way
of clearing the outlet from the activated outlet component
as well as providing a warning about how the commands are applied.

Lastly, there is a small bit of guidance provided for developers who
might want to explore the ability to close an outlet from any location
in the app, without needing to be aware of the activated route.
An example of this can be found here:
https://stackblitz.com/edit/close-outlet-from-anywhere

resolves #13523

Question to reviewers:
I wonder if I should omit the last bit about closing the outlet using navigateByUrl because it goes beyond the common use-cases of just closing the outlet from either the parent that opened it or the activated child itself.
It's quite an advanced topic and complicated to explain but may still be something that devs want to do.

The example for clearing secondary outlets currently only works because
the named outlet appears at the root of the application's route config.
If developers follow this example with an outlet that is not at the
root level, they will not be able to close the outlet.
This commit updates the example to provide a more robust way
of clearing the outlet from the activated outlet component
as well as providing a warning about how the commands are applied.

Lastly, there is a small bit of guidance provided for developers who
might want to explore the ability to close an outlet from any location
in the app, without needing to be aware of the activated route.
An example of this can be found here:
https://stackblitz.com/edit/close-outlet-from-anywhere

resolves angular#13523
@atscott atscott added comp: docs action: review The PR is still awaiting reviews from at least one requested reviewer area: router target: patch This PR is targeted for the next patch release labels Dec 28, 2020
@google-cla google-cla Bot added the cla: yes label Dec 28, 2020
@ngbot ngbot Bot modified the milestone: Backlog Dec 28, 2020
@google-cla

google-cla Bot commented Dec 28, 2020

Copy link
Copy Markdown

鈽癸笍 Sorry, but only Googlers may change the label cla: yes.

@mary-poppins

Copy link
Copy Markdown

You can preview 8c8466c at https://pr40272-8c8466c.ngbuilds.io/.

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

This comment has been minimized.

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

This comment has been minimized.

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

This comment has been minimized.

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

This comment has been minimized.

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

pullapprove Bot commented Dec 29, 2020

Copy link
Copy Markdown

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

pullapprove Bot commented Dec 29, 2020

Copy link
Copy Markdown

@atscott atscott left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullapprove-test

@pullapprove

pullapprove Bot commented Dec 29, 2020

Copy link
Copy Markdown

@atscott atscott mentioned this pull request Dec 29, 2020
3 of 14 tasks

@kapunahelewong kapunahelewong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this, @atscott 馃槉

Just a few suggestions on copy. Also, what do you think of removing the alert styling from the second and third alerts and just leaving them as two paragraphs that follow the is-critical? (Just because it's three in a row.)

Comment thread aio/content/guide/router-tutorial-toh.md
Comment thread aio/content/guide/router-tutorial-toh.md
Comment thread aio/content/guide/router-tutorial-toh.md
Comment thread aio/content/guide/router-tutorial-toh.md
Comment thread aio/content/guide/router-tutorial-toh.md
Comment thread aio/content/guide/router-tutorial-toh.md
@atscott

atscott commented Jan 5, 2021

Copy link
Copy Markdown
Contributor Author

@kapunahelewong thanks for the review! I removed the second and third alerts - I think that was a good idea.

@atscott atscott added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 5, 2021
@atscott
atscott requested review from kapunahelewong and removed request for aikithoughts January 5, 2021 19:10
@atscott

atscott commented Jan 5, 2021

Copy link
Copy Markdown
Contributor Author

Closing, see discussion in #40225

@atscott atscott closed this Jan 5, 2021
@angular-automatic-lock-bot

Copy link
Copy Markdown

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.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: router cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigating with outlets is confusing: outlets map does not apply to consumed segments

4 participants