简体   繁体   English

如何将表单数据发送到使用 window 打开的独立组件。打开

[英]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.

相关问题 如何发送从输入表单中获取的数据,然后将它们发送到我的 email 地址,而无需打开新的 window? 我目前正在使用 angular-cli - How to send data which get from the input form then send them to my email address without open a new window? I am currently using angular-cli 在chrome中模拟href来打开新标签页,而不是窗口。 不使用onclick - Simulation an href in chrome to open a new tab, not window. Not using onclick 如何重定向URL将自身打开为弹出窗口。 “ RedirectToURL()”? - How to redirect a URL open itself as popup window. “ RedirectToURL()”? 使用window。“ plugin” cordova - Using window.“plugin” cordova <a>在新窗口中打开。</a> <a>但是标准是_blank</a> - Open <a> in a new window. But standard is _blank 在新窗口中打开谷歌地图。 - Open google map in new window. 隐藏Zendesk聊天按钮可打开聊天窗口。 可以解决吗? - Hiding Zendesk chat button opens chat window. Any fix? 如何创建一个Mailto共享按钮,该按钮会打开一个窗口,用户可以在其中输入要发送到的电子邮件地址 - How to Create a Mailto Share Button that Opens a Window in which Ones Can Enter Email Address to Send to Javascript,在确认窗口中按OK后清除表格。 但如果确认被取消则保留表格数据 - Javascript, clear form after press OK in confirm window. But keeps form data if confirm is cancelled 为什么window.open不打开以var给出的链接? - Why window.open do not opens a link which is given as var?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM