first of all: non-set answer, really a little no, really a little do not understand, solve!
function getMatchedData(data,match){
var result = data;
var attrs = _______;
attrs.each(function(obj){
result = typeof result == "object" && result.hasOwnProperty(obj) ? _____ : ______;
});
result = typeof result == "undefind" ? "" : result;
return result;
}
function templateDataMapping(temp,data){
if(temp){
var matches = temp.match(/{{[a-z_A-Z](\w+)?([\.][a-z_A-Z](\w+)?)*}}/g);
matches.each(function(index,match){
temp = temp.replace(match,getMatchedData(data,match.substring(2,match.length-2)));
})
}
return temp;
}