// Scroll to element in angular // HTML File <button (click)="scroll(target)">Click to scroll</button> <div #target>Your target</div> // In Ts File: scroll(el: HTMLElement) { el.scrollIntoView({behavior: 'smooth'}); }<button (click)="scroll(target)"></button> <div #target>Your target</div> scroll(el: HTMLElement) { el.scrollIntoView(); }