After spending countless hours, even a couple of days, trying to solve this issue, I still can't find a solution. I've exhausted all options and haven't come across a similar case.
My goal is to smoothly scroll to another component on my one-page website from a navigation bar, which is a separate component. The structure of my main app component is as follows:
<body>
<app-navbar></app-navbar>
<app-page-one id="page-one"></app-page-one>
<app-page-two id="page-two"></app-page-two>
<app-page-three id="page-three"></app-page-three>
<app-footer></app-footer>
</body>
Each component has a unique id assigned for identification during scrolling.
I am trying to implement a feature where clicking the "Page Three" button in the navbar will smoothly scroll down to the page three component. The structure of my navbar component is as follows:
<body class="body">
<header class="header">
<a href="#" class="logo">LOGO</a>
<div class="menu-toggle">
<fa-icon [icon]="faBars" transform="grow-20"></fa-icon>
</div>
<nav class="nav">
<ul>
<li>
<a href="#">Page One</a>
</li>
<li>
<a href="#">Page Two</a>
</li>
<li >
<a href="#">Page Three</a>
</li>
</ul>
</nav>
</header>
</body>
I have attempted using Ngx Page Scroll and other methods, but have been unable to achieve the desired functionality. I am considering using Input Output for communication between components. Any suggestions or guidance would be greatly appreciated. Thank you.