在角度2我需要创建一个带有冗余部分的大型html模板.因此,我想创建多个html模板,并将它们包含在主html文件中(如angular1中的ng-include)
但是如何在主模板中包含子模板?
例:
<!-- test.html -->
<div>
this is my Sub-Item
<!-- include sub1.html here-->
</div>
<div>
this is second Sub-Item
<!-- include sub2.html here-->
</div>
Run Code Online (Sandbox Code Playgroud)
-
<!-- sub1.html -->
<div>
<button>I'am sub1</button>
</div>
Run Code Online (Sandbox Code Playgroud)
-
<!-- sub2.html -->
<div>
<div>I'am sub2</div>
</div>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
32892 次 |
最近记录: |