हां यह संभव है और आपको कुछ विशेष करने की आवश्यकता नहीं है, आपको बस सामग्री को संकलित करने की आवश्यकता है। http://jsfiddle.net/gWgYM/
एचटीएमएल:
<div ng-app="app" ng-controller="test">
<h1>The date is {{date}}</h1>
<iframe frame=""></iframe>
</div>
जावास्क्रिप्ट:
var app = angular.module('app', []);
app.controller('test', function($scope) {
$scope.date = new Date();
window.setInterval(function() {
$scope.date = new Date();
$scope.$apply();
}, 1000);
});
app.directive('frame', function($compile) {
return function($scope, $element) {
var $body = angular.element($element[0].contentDocument.body),
template = $compile('<p>The date in the iframe is {{date}}</p>')($scope);
$body.append(template);
};
});
यहाँ एक उदाहरण है