Check out this JSFiddle link to get started.
HTML Code:
<iframe id="iframe" src="http://fiddle.jshell.net/"></iframe>
<div id="test">click me</div>
jQuery Script:
$( "#test" ).on("click", function() {
var iframe = $("#iframe").contents();
iframe.find('#header').css('background-color', 'red');
iframe.find('#header').html('My content');
});
CSS Styling:
iframe {
height: 500px;
width: 800px;
}
Question:
- In the provided example, jQuery allows us to manipulate the DOM content of an iframe effortlessly. Can the same functionality be achieved with AngularJS? Any examples?
- If not, is it possible using ngInclude? Show an example if applicable.