简体   繁体   中英

AngularJs: bind server-side rendered html to iframe

my angular app is an html editor which sends the template to a server where it is rendered with dynamic data and returned to the client where it should be inserted into an iframe (for preview purpose). ng-bind-html seams not to work in combination with an iframe. is there a way to set the content of an iframe dynamically with angularjs?

edit: the main problem of these templates is that they correspond to completly independent html documents (doctype, css, markup, etc.); hence it is necessary to encapsulate the rendered result within some kind of sandbox.

我不知道如何将内容发送到iframe但是您可以使用ng-include代替iframe。

<div ng-include="frameUrl" ></div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM