I found the solution differently and using JavaScript.
Suppose that I am in "/ menu" and I want to go to "/ home" when the back button is pressed. Check out the following code snippet.
ngOnInit() {
window.history.pushState( {} , 'Home', '/home' );
window.history.pushState( {} , 'Menu', '/menu' ); }
window.history ngOnInit(). -, URL (/home), , , URL (/menu).
, , .