If your iframe :
<iframe id='iframe' width='100%' height='600px' src='http://test.com' />
Your controller might look something like this:
AppName.controller('someNameCtrl', ['$scope', '$window', function ($scope, $window) { $scope.width = '100%'; $scope.height = '600px'; angular.element($window).bind('resize', function(){ $scope.width = $window.innerWidth; $scope.height = $window.innerHeight; console.log($scope.width, "x", $scope.height);
Then you can play with style as a variable
<iframe id='iframe' ng-style="{ height: height, width: width }" src='http://test.com' />
Ricky levi
source share