pageScroll directive stopped from working after we changed to SSR so I am using the service at the moment.
Everything works great except for page scrolling to id in other view using router-link, it used to work with the directive but now it doesn't.
@Directive({
selector: '[appScrollToView]'
})
export class ScrollToViewDirective {
@Input()
public id: string; // the id of the element to navigate when this element being clicked
public scrollDelay = 0;
constructor(private readonly pageScrollerService: PageScrollerService) { }
@HostListener('click')
public click() {
this.pageScrollerService.scroll(this.id);
}
}
pageScroll directive stopped from working after we changed to SSR so I am using the service at the moment. Everything works great except for page scrolling to id in other view using router-link, it used to work with the directive but now it doesn't.
<button class="st-root-link nav-link" appScrollToView [routerLink]="['/']" [id]="'id-in-other-route'">
This is my directive like so:
This is the service it's calling:
Html:
<button class="st-root-link nav-link" appScrollToView [routerLink]="['/']" [id]="'no-more-paper'">