简体   繁体   English

Bootstrap Modal Angular 2中的iFrame

[英]iFrame in Bootstrap Modal Angular 2

I am loading an iFrame of another page(not in Angular code) in my Angular component's Valor's Bootstrap Modal. 我正在Angular组件的Valor's Bootstrap Modal中加载另一个页面的iFrame(不在Angular代码中)。 What I want to achieve is that, an action in the iFrame must trigger a function in my Angular component. 我要实现的是,iFrame中的操作必须触发Angular组件中的函数。 I have looked at various similar questions (which suggested using the window or parent objects) but I was not able to obtain a workable solution for this particular use case. 我看过各种类似的问题(建议使用窗口或父对象),但是我无法针对此特定用例获得可行的解决方案。

The answer is so simple, I need to enable cross frame access that is not safe. 答案很简单,我需要启用不安全的跨框架访问。 So I went on by using postMessage to securely transfer data via cross-frame. 因此,我继续使用postMessage通过跨框架安全地传输数据。

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

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