Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Does this approach work with named router outlets though? Say I have several on the page and only want to go back on one of them, would this work? Commented Feb 9, 2018 at 10:25
  • You'll have to use a different approach for that situation. If you had the same back button in two different router outlets, they will probably both do the same thing and go back on the last router outlet that was changed. Commented Feb 14, 2018 at 23:00
  • For named outlets, I found that this approach worked: this.router.navigate(['../'], {relativeTo: this.route}) Commented Feb 15, 2018 at 8:11
  • How to use this component inside another component? Commented May 29, 2019 at 12:21