JSFiddle - React, Tailwind, and code Playground
by jpeter06
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.6/handlebars.js"></script>
<script id="Template" type="text/template">
<ux-list-item
primary_text="{{lookup initData (concat 'alternateContactLabel' implEAddressType.eAddressType)}}"
>
</ux-list-item>
</script>
JavaScript
var raw_template = document.getElementById('Template').innerHTML;
var template = Handlebars.compile(raw_template);
Handlebars.registerHelper('concat', function () {
return Array.prototype.slice.call(arguments, 0, -1).join('');
});
console.log(template({
"initData": {
"alternateContactLabelM":"Alternative Mobile Number (SMS)",
"alternateContactLabelE":"Alternative Email Address",
"alternateContactLabelPH":"Alternative Contact Number",
"alternateContactLabelFX":"Alternative Fax"
},
"implEAddressType": {
"eAddressType": "E"
}
}));