Angular router and browser back button
In my Angular app(version 13), I have three components: A, B, and C, each corresponding to routes route-A, route-B, and route-C, respectively. Consider a routing scenario where I route from route-A to route-B by clicking a button. And in component B I have some logic in ngOnInit() depending on that logic it routes from route-B to route-C sometime. But the problem is from C component when I click browser back button it takes me to the component A. But I want to go back to component B instead of A. How can I achieve that?