For example I am from the current url http://localhost:4200/#/transactions/overview/5?tab=2
and then I navigated to http://localhost:4200/#/deals/detail/
When I refresh the deals/detail page I want to go back to the previous url which is for example http://localhost:4200/#/transactions/overview/5?tab=2
.
How do we address this is angular ? Thank you for help and ideas.
#code for navigating to deals/detail page
editDeal(deal:any){
let dealType = '';
const state = {
data: {
transaction: this.transaction,
},
}
this.gotoDealDetails(state);
}
gotoDealDetails(state:any){
this.route.navigateByUrl(`deals/detail/`, {state: state});
}
#detail details page component
export class DealDetailsComponent implements OnInit {
dealDetails = null;
leaseDetails = null;
currentRentSchedule = [];
isInEditMode = false;
fiscalYear = null;
pmrType = null;
partnerType: any;
constructor(
private _route: Router,
private _dealService: DealService,
private dialog: MatDialog,
private _notificationService: NotificationService) {
this.urlData = this._route.getCurrentNavigation().extras.state.data
}
ngOnInit(): void {
}
ngAfterViewInit() {
}
}