2

I have some iframe:

<iframe src="/node_modules/collaborator-gallery/dist/index.html?id=3823&amp;auto_play=true&amp;track=true&amp;initialWidth=1290&amp;childId=pymd-aaeafe70-910d-494b-ac6b-e68d8eb2de66&amp;parentUrl=http%3A%2F%2Flocalhost%3A8080%2Fresources%2Fexecute%2F20895"
width="100%" scrolling="no" marginheight="0" frameborder="0" class="embed-responsive-item" height="480px"></iframe>

through it I use the gallery. How do I get to events through another component in Angular 6

Sachi.Dila
  • 1,126
  • 7
  • 15
  • this might help: https://stackoverflow.com/questions/46172057/angular-4-iframe-to-be-populated-in-innerhtml – sdn404 Sep 04 '18 at 18:38

1 Answers1

0

In window A's scripts, with A being on http://example.com:8080:

`var popup = window.open(...popup details...);
popup.postMessage("The user is 'bob' and the password is 'secret'", "https://secure.example.net");
popup.postMessage("hello there!", "http://example.com");`

`function receiveMessage(event) {
  if (event.origin !== "http://example.com")
    return;
  // event.data is "hi there yourself!  the secret response is: rheeeeet!"
}`
`window.addEventListener("message", receiveMessage, false);`

Called sometime after postMessage is called

`

function receiveMessage(event) {
  if (event.origin !== "http://example.com:8080")
    return;
  // event.data is "hello there!"
  event.source.postMessage("hi there yourself!  the secret response " + "is: rheeeeet!", event.origin);
}`

window.addEventListener("message", receiveMessage, false);