scrolling after page load with components in angular 1.5
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.
+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
+1