Partials Vorlage Unterstrich (wie bei LENKER)?

Ich habe ein Rückgrat Modell wie diesem

var PeopleModel = Backbone.Model.extend({
defaults: {              
    "people": [
          { "username": "alan", "firstName": "Alan", "lastName": "Johnson", "phone": "1111", "email": "[email protected]" },
          { "username": "allison", firstName: "Allison", "lastName": "House", "phone": "2222", "email": "[email protected]" },
          { "username": "ryan", "firstName": "Ryan", "lastName": "Carson", "phone": "3333", "email": "[email protected]" },
          { "username": "ed", "firstName": "Edward", "lastName": "Feild", "phone": "4444", "email": "[email protected]" },
          { "username": "phil", "firstName": "Philip", "lastName": "Doom", "phone": "5555", "email": "[email protected]" },
          { "username": "gerald", "firstName": "Gerald", "lastName": "Butler", "phone": "6666", "email": "[email protected]" }
    ],
    "company": {"name": "Random Corp."},
    "country": "England"
}

});

Und hier sind meine Vorlagen

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

Dies ist, wie ich das umgesetzt, teilweise mit handlebars.js.

Meine Fragen

1.Wir haben etwas ähnliches, ich meine die Teiltöne incase underscore.js template-engine?

2.Wenn ja, wie machen wir das umsetzen, teilweise in underscore.js template-engine

InformationsquelleAutor bhargav | 2012-07-02
Schreibe einen Kommentar