I have the current template:
<div id="top">
...
</div>
In the component I have the following method:
onTripSave() {
let top = document.getElementById('top');
if (top !== null) {
top.scrollIntoView();
top = null;
}
}
This method scroll to top after finish save which works correctly. I need the scrollIntoView to not just scroll to top, I would make animation for that scroll. Please note that I'm using rxjs 6 so I need code with pipe I guess.