<div class="content">
<h1>Title</h1>
{{ include("../tags/inputBox",{name:'abcd',value:1234}); }}
</div>
<div class="content">
<h1>Title 2</h1>
{{ include("../tags/inputBox",{name:'efg',value:567}); }}
</div>
或者它不提供?
<div class="content">
<h1>Title</h1>
{{ include("../tags/inputBox",{name:'abcd',value:1234}); }}
</div>
<div class="content">
<h1>Title 2</h1>
{{ include("../tags/inputBox",{name:'efg',value:567}); }}
</div>
或者它不提供?
您希望通过Angular(绑定,创建组件,指令等)处理的模板必须静态提供。有一些丑陋的解决方法在未来没有任何保证。
唯一正式支持的方法是,据我所知DynamicComponentLoader
如果你正在谈论注入动态模板与价值观,解析它,表现它和所有与ng-include
(#Angular1
)有点指令然后look at here github issue(fyi #Angular2)
,它明确提出
ng-include
不会被添加,因为它有安全问题
但是你一定可以使用DynamicComponentLoader。
是不是像'ng-include'? – micronyks
是的,可能是! – sanu0074