We can add a anchor element with id and by pasting the id as fragment in the link it will scroll to that section.
But the challenge here is, If we add fragment and anchor present in same page it is going to scroll. But I am navigating to different page and fragment is being added while navigating, but is not scrolling to that section.
Reason is due lazy loading of child components. When Navigating, the components are not available yet, and that's reason not scrolling.
A workaround is to add some javascript functionality in ngAfterViewInit like ScrollIntoView
. But Looking for any other approaches if possible.
Putting all these words in line On Click of Button, Navigate to another page and scroll to particular section in Angular Application
Its pretty straightforward with Router.Navigate. you can use the fragment with the ID
of the element you want to navigate to.