my.component.ts に 以下の3つを追加
import { Location } from '@angular/common';
constructor(
private location: Location
) {
}
private backBtnClick() {
this.location.back();
}
my.component.html に戻るボタンを設置
<button (click)="backBtnClick()" type="button">戻る</button>