I am trying to set the iframe content height through angular
I have something like
app.controller('testCtr' ['$scope', '$window' ), function() {
   var newWin = $window.open();
   newWin.document.write("<iframe id='iframe' width='100%' height='100%' 
   src='http://www.yahoo.com'></iframe>");
   var iframe = newWin.document.getElementById('iframe');
   iframe.addEventListener('load', function() {                    
       //after iframe is loaded, I want to set the hight of the contents here
       var t =  iframe.contentWindow.document.body.offsetWidth;              
       //console.log(t)  -> return undefined.   
       iframe.contentDocument.body.scrollWidth = '500px';
       iframe.contentDocument.body.scrollHeight = '500px';
   })
}])
How do I accomplish this?