I want to create anchor in my angular page but it doesn't work and I don't know why.
My html component :
<h1 id="choose_package">Step 1 : choose a package</h1>
<div>Some elements</div>
<a [href]="choose_package">test</a>
But it return me null and go to 404 page.
Edit (now I can scroll but it's not done little by little):
this.router.events.pipe(filter(e => e instanceof Scroll)).subscribe((e: any) => {
if (e.position) {
this.viewportScroller.scrollToPosition(e.position);
} else if (e.anchor) {
this.viewportScroller.scrollToAnchor(e.anchor);
} else {
this.viewportScroller.scrollToPosition([0, 0]);
}
;
});