简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM