Is it possible to update angularjs expressions inside of an iframe?
So...for example, I am trying to pull in an email "template" into an
iframe as a "preview" for the user inside of an angularjs app. The iframe
lives inside of the controller area (let's call it MainCtrl). The user
would then be able to, using the form elements provided inside MainCtrl,
update the preview based on their input. So for example let's say our
template being pulled into the iframe looks something like this:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1">
<style type="text/css">
.some {styles: here};
</style>
</head>
<body>
<h1></p>
</body>
</html>
So inside our index.html (angularjs app), we would have form elements
bound to {{header}} and {{body}}...
<div ng-controller="MainCtrl">
<input type="text" ng-model="header" placeholder="header text" />
<input type="text" ng-model="body" placeholder="body text" />
<iframe src="template.html" width="800" height="1500"></iframe>
</div>
is that possible? Is it possible for angularjs to update that information,
and if so, how?
No comments:
Post a Comment