Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To add an Angular back button to the stack router outlet in Chrome, you can follow the below steps:

  1. Import the Location service in your component
import { Location } from '@angular/common';
  1. Inject the Location service in your component's constructor
constructor(private location: Location) { }
  1. Add a method to go back to the previous page
goBack() {
  this.location.back();
}
  1. In your template, add a button with a click event that triggers the goBack() method
<button (click)="goBack()">Back</button>
  1. You can style the button according to your preference using CSS.

With these steps, you should be able to add a back button to your stack route outlet in Chrome.