K
K
klinnov2017-01-13 16:35:14
JavaScript
klinnov, 2017-01-13 16:35:14

How to use easyXDM + angular to change iframe height?

Hello!
There is a provider:

$rootScope.$on('$viewContentLoaded', function(){
                var socket = new easyXDM.Socket({
                    onReady: function () {
                        socket.postMessage(document.body.scrollHeight);
                    }
                });
});

There is a client:
var socket = new easyXDM.Socket({
        remote: "https://url", // the path to the provider
        container: document.getElementById("container"),
        onMessage: function(message, origin){
        console.log(message);
        this.container.getElementsByTagName("iframe")[0].style.height = message + "px";
    }
    });

A height of around 150 px comes from the provider to the client, which is not true. I understand the problem is that Angular is used? Hung up on $viewContentLoaded - without changes.
How to get around this? Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question