I have a component in angular containing multiple child component. It also has logic for hiding and showing component on the basis of condition within that component. eg.
<div *ngFor="let data of dataSource; let i=index">
<child-component [dataOne]="data.one"></child-component>
<mat-divider></mat-divider>
<second-child-component [dataTwo]="data.two"></second-child-component>
</div>
I want to implement the functionality of navigating back without the page refresh and back to position where it previously was.
I did it by injecting the Location
in constructor and using the back()
method of it. However it reinitialize the previous component.
How do I do that? Any help would be much appreciated. Thanks!