[英]How to send form data to a independent component which opens using window. Open
I have to send the form data( on button click) to a another component which don't have any relationship.我必须将表单数据(单击按钮时)发送到另一个没有任何关系的组件。
Now my requirement is i need to send this form data to another window where the component loads using window.open.现在我的要求是我需要将此表单数据发送到另一个 window,其中组件使用 window.open 加载。
Now please tell me how can i use window.open to send this form data to another page??现在请告诉我如何使用 window.open 将此表单数据发送到另一个页面?
Thanks in advance.提前致谢。
One way could be to use a shared service.一种方法是使用共享服务。
Component 1 sends form data to -> Service eg via subscription.组件 1 将表单数据发送到 -> 服务,例如通过订阅。
On window.open Component 2 subscribes to -> Service to check if there is data. window.open 组件2订阅->Service查看是否有数据。
https://enlear.academy/sharing-data-between-angular-components-f76fa680bf76 https://enlear.academy/sharing-data-between-angular-components-f76fa680bf76
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.