私はこのようなバックボーンモデルを持っています
var PeopleModel = Backbone.Model.extend({
defaults: {
"people": [
{ "username": "alan", "firstName": "Alan", "lastName": "Johnson", "phone": "1111", "email": "alan@test.com" },
{ "username": "allison", firstName: "Allison", "lastName": "House", "phone": "2222", "email": "allison@test.com" },
{ "username": "ryan", "firstName": "Ryan", "lastName": "Carson", "phone": "3333", "email": "ryan@test.com" },
{ "username": "ed", "firstName": "Edward", "lastName": "Feild", "phone": "4444", "email": "ed@test.com" },
{ "username": "phil", "firstName": "Philip", "lastName": "Doom", "phone": "5555", "email": "phil@test.com" },
{ "username": "gerald", "firstName": "Gerald", "lastName": "Butler", "phone": "6666", "email": "gerald@test.com" }
],
"company": {"name": "Random Corp."},
"country": "England"
}
});
そして以下は私のテンプレートです
<script id="people-template" type="text/x-handlebars-template">
{{#each people}}
{{> person}}
{{/each}}
</script>
<script id="person-partial" type="text/x-handlebars-template">
<div class="person">
<h2>{{fullName}} </h2>
<div class="phone">{{phone}}</div>
<div class="email"><a href="mailto:{{email}}">{{email}}</a></div>
</div>
これは、handlebars.jsを使用して部分的に実装した方法です。
私の質問
1.似たようなものがありますか?underscore.jsテンプレートエンジンの場合のパーシャルを意味しますか?
2.もしそうなら、underscore.jsテンプレートエンジンに部分的に実装するにはどうすればよいですか?