-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to scroll to a component from another component? #104
Comments
To add to the message, document.getElementByid('id') finds it perfectly fine. |
Hi, the second parameter of the
In future versions it might be possible to select scrollTargets based on other thinks than the |
Hello, There is no more error in the console about missing target but it doesn't scroll at all when I press the button. Am I not getting smth? |
I assume you have to use a custom scrollView, as the material2 sidenav directive introduces a non-trivial DOM hierarchy: https://github.com/Nolanus/ng2-page-scroll/wiki/Using-the-right-scrolling-view |
Hello again, Apologies for missing. I tried to determine, which element had $0.scrollTop equal to a non-zero value but all of them returned 0 o_O so I am not really sure to which element I should even bind it. My app.component.html looks like this
|
Check that plunkr using md-sidenav from material2 library: https://plnkr.co/edit/mmBS1AZv7Jd7eCTrFCOZ?p=preview The scrollable view is the |
Freaking brilliant. Thanks a lot. I've been trying to wrap my head around it for hours. |
I got the app.component.html having smth like this
And I want to scroll to projects so I assign the ID to it, but the button itself is inside app-top-nav component
<button pageScroll href="#awesomePart" fxHide fxShow.gt-md md-button>Offers</button>
So when pressing it nothing happens. I generated the project with Angular-Cli and added it dependency in the app.modules.ts
So, how do I make it work with communicating between components? I tried using a shared service
and then using it within the component where button click occurs, but it throws me
Scrolling not possible, as we can't find the specified target
Even though I know the id is correct.
The text was updated successfully, but these errors were encountered: