angular-scroll icon indicating copy to clipboard operation
angular-scroll copied to clipboard

scrolling after page load with components in angular 1.5

Open mcblum opened this issue 9 years ago • 2 comments

Hi!

Thanks for your work on this. We have an issue where our page is essentially a component tree and we think the code is failing because the elements haven't actually loaded yet. Any idea what we can do?

Thanks! Matt

Edit: It turns out it is sometimes working, but Angular seems to be adding a / before the # which the library does not like. If I remove $anchorScroll from the initial page load, the address is correct but the page doesn't move. If I leave $anchorScroll in there, it adds the / and if I remove it, it scrolls to the correct anchor, and then puts the / back. So weird.

mcblum avatar Jul 15 '16 22:07 mcblum

+1

I'm looking for a way to trigger scroll on page load from a URL query string. I keep getting $document.getElementById is not a function. It works fine when triggered from a button on the page. I've tried various things – like putting the code in a link function but always it can't run on load.

This with a different implementation, this is the error I get: TypeError: Cannot read property 'getBoundingClientRect' of undefined

geoidesic avatar Feb 24 '17 16:02 geoidesic

+1

estebancoria avatar Jun 22 '18 20:06 estebancoria