说我有控制器名为" test"用:
$scope.testValue = "Hello World!";
的index.html:
<div ng-controller="test">
<iframe iframe-directive src="template.html"></iframe>
</div>
template.html:
{{testValue}}
iframe指令如何编译并输出&#34; Hello World&#34;而不是&#34; {{testValue}}&#34;?
答案 0 :(得分:0)
只需将其置于iframe指令中即可使用
link: function(scope,elem,attrs) {
$compile(elem.contents())(scope);
}