【发布时间】:2017-12-02 19:20:40
【问题描述】:
假设我有一个 template.html 和 2 个子模板(sub-template1.html 和 sub-template2.html),我如何让它们在 template.html 中呈现,并使用类和 ID,以及 sub-template2.html 中的 sub-template1.html 中的其他 DOM 相关变量。
例如:sub-template1.html 有一个视频,我需要在 sub-template2.html 中访问它的当前时间
<!--template.html-->
<html>
<head>
<title></title
</head>
<body>
<!--- sub-template1.html -->
<br>
<!--- sub-template2.html -->
</body>
</html>
<!-- sub-template1.html -->
<div>
<video></video>
</div>
<!-- sub-template2.html -->
<div>
<h1> <!-- current time from video in sub-template1.html --></h1>
</div>
【问题讨论】:
标签: javascript jquery html angular2-template