I want to be able to scroll to a target when a button is pressed. I was thinking something like this.
You could do it like this:
Your target
and then in your component:
scroll(el: HTMLElement) {
el.scrollIntoView();
}
Edit: I see comments stating that this no longer works due to the element being undefined. I created a StackBlitz example in Angular 7 and it still works. Can someone please provide an example where it does not work?