P
P
prolina2019-08-06 00:00:35
Angular
prolina, 2019-08-06 00:00:35

Anchor in angular?

You need to make an anchor without using any third-party libraries. When you click on the link, there should be a transition to the top of the page. That is, at the bottom of the page, click on the link "Back to top" and the page scrolls to the very top. I thought about making a transitional header (this is a separate component that is on all pages), but I don’t know how to implement this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-08-06
@Xuxicheta

Why anchor when you can scroll to the top of the page using ViewportScroller, an angular wrapper over native scroll methods.
https://ng-run.com/edit/JjqNO5JgMXGeskADd0ne

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question