前端模板技术不是什么新技术了,有很多知名的js模板引擎,如:HandlebarsJS、Mustache 、artTemplate、还有我最近在学习的ionic框架等。这些模板引擎一般都是使用<script>来承载模板内容。
下面是HandlebarsJS的模板:
<script id="entry-template" type="text/x-handlebars-template">
<div class="entry">
<h1>{
{title}}</h1>
<div class="body">
{
{body}}
</div>
</div>
</script>
<script id="my-popover.html" type="text/ng-template">
<ion-popover-view>
<ion-header-bar>
<h1 class="title">My Popover Tit