I am new to Angular. I have 2 views, one:
<div class="block">
<p>
one works!
</p>
</div>
<router-outlet></router-outlet>
and two
<div class="block">
<p>
two works!
</p>
</div>
I have created some CSS:
.block {
height: 1000px;
background-color: pink;
}
The idea is that two is a child of one but when you are on two, the content for one is still visible. This works with no issues.
The problem, is that when I navigate to two, the page still stays at the top. I would like it to scroll (animated if possible) to the top of the <router-outlet>
or two.
Can this be done?