This is a feature that I used on one of my sites. I changed the code to be placed in the directive.
Note. In iframe, your container must have ifrm_container
<iframe resize-iframe id="iframe" src="..."> .directive('resize-iframe', function() { return { restrict: 'A', link: function ( scope, elm, attrs ) { var container = elm.contentWindow.document.getElementById('ifrm_container');
I tested this solution on all browsers, even IE7, and it works well, but not in the directive (some element has been changed).
THIS DIRECTIVE IS NOT TESTED
source share