add path to browser search on viewportScroller.scrollToAnchor code example
Example: smooth scroll in viewportscroller
//HTML
<button (click)="scrollToElement(target)"></button>
<div id="target" #target>Your target</div>
//Ts code :
scrollToElement($element): void {
console.log($element);
$element.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});
}