Angular click directive scroll to section of page within modal-dialog not working with dynamic content

788 Views Asked by At

Looking to scroll to page sections when user clicks using scrollIntoView in a modal with dynamic content.

I've tried using ViewChild, event emitting, and ngAfterViewChecked but no luck.

Code: https://stackblitz.com/edit/ng-bootstrap-modals-bdg1bh?file=src/app/modal-container/modal-container.component.ts

1

There are 1 best solutions below

2
Mojtaba Nejad Poor Esmaeili On

i had same problem. for me the solution was change (click) events to onclick and write typescript scroll functions in script tag.

https://stackblitz.com/edit/ng-bootstrap-modals-6jtnrm?file=src%2Findex.html,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fmodal-container%2Fmodal-container.component.ts