Context:
I've been developing a portfolio page and wanted to put my knowledge of Angular to use. All was going fine on localhost but when I deployed, saw that the page would load mid-page.
A better example of what I'm referring to
Through GitHub, I saw that this was a reported problem and have tried a few suggested workarounds that haven't changed anything so I come humbly to you, oh mighty Stack Overflow, to see if anyone had either suggestions of workarounds or an explanation as to why that happens in the first place.
Thanks in advance!
Please try to use window's scroll method in ngOnInit().
window.scroll(0,0);
ngAfterVIewChecked is called every time Angular has finished running change detection on a component and it's children.
So you can also try to set in ngAfterVIewChecked() method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With