JSFiddle - React, Tailwind, and code Playground

by anilkamath87

HTML

<script src="http://www.handlebarsjs.com/"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js"></script>
<script type="text/x-handlebars-template" id="adTmpl-caseIntents">
    <div class="intentholder">
    <ul>
        {{#each intents}}
           <li class="btn" value="{{ AutodocI18n this }}" />
        {{/each}}
    </ul>
    </div>
</script>

JavaScript

var AutodocResourceJson=[];
AutodocResourceJson['anil']='value';
AutodocResourceJson['kamath']='rahul';
Handlebars.registerHelper('AutodocI18n',
           function (str) {
               console.log(str);
               if(AutodocResourceJson) 
               return new Handlebars.SafeString(( != undefined ? AutodocResourceJson[str] : str));
           }
       );

var caseFormTemplate=Handlebars.compile($('#adTmpl-caseIntents').html()); //TODO: move it to utilities as you dont want to compile this everytime
var intents=['anil','kamath'];
console.log(caseFormTemplate({intents:intents}));