I started using mustache and want to know how to load different parts of a template. Like this.
require(['jquery','stache!templates/message'], function($, template) {
'use strict';
var person1 = {
firstName: "John",
};
$('#container1').html(template(person1))
var person2 = {
lastName: "Petersen",
};
$('#container2').html(template(person2))
});
And the html template message.html.
This should only loaded in container1
<h1>{{firstName}}</h1>
This should only loaded in container2
<h1>{{lastName}}<h2>
How can I do that?