Just try
<iframe id="iframe" src="./data-model.html" my-iframe></iframe>
var app = angular.module("myTestIframe", []);
app.controller('MyCtrl',function($scope){
});
app.directive("myIframe", function() {
return {
restrict: "A",
link: function (scope,element) {
console.log(element.css('background-color', 'red'));
}
}
});
If you include the jquery library, you can also control the element with $ (element)
source
share