I am using angular 14, We want to scroll the menu in the one-page application by its id. and how to get the ID from another component in the ts file.
header.component.html
<li class="nav-item active " (click)="scolluser()" *ngFor="let users of user">
header.component.ts
scolluser() {
this.scroller.scrollToAnchor("service"); // get id dynamically from another components
}