2016-03-10 98 views
0

例如:我可以在Angular 2中使用標籤模板嗎?

<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> 

或者它不提供?

+0

是不是像'ng-include'? – micronyks

+0

是的,可能是! – sanu0074

回答

1

您希望通過Angular(綁定,創建組件,指令等)處理的模板必須靜態提供。有一些醜陋的解決方法在未來沒有任何保證。

唯一正式支持的方法是,據我所知DynamicComponentLoader

相關問題