繁体   English   中英

Angular 单击指令滚动到模态对话框中的页面部分不适用于动态内容

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

当用户在具有动态内容的模式中使用 scrollIntoView 进行单击时,希望滚动到页面部分。

我尝试过使用 ViewChild、事件发射和 ngAfterViewChecked,但没有运气。

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

我有同样的问题。 对我来说,解决方案是将事件更改(单击)到 onclick 并在脚本标记中编写 typescript 滚动函数。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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