title: Handlebars render templates based on value
body: <p>I have the follow data</p>
  
  <pre><code>multipleTypes = [
          {"type": "radio", "label": "Cool people names","option": ["Ralgar", "Mozzy"]},
          {"type": "checkbox", "label": "Cool phones", "option": ["android", "iphone"]}
          {"type": "radio", "label": "Cool pets", "option": ["monster", "moose"]},
          {"type": "checkbox", "label": "Cool places", "option": ["bar", "undercovers", "moon"]},
      ]
  </code></pre>
  
  <p>Here are the templates</p>
  
  <pre><code>&lt;script id="checkbox-template" type="text/x-handlebars-template"&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;{{label}}&lt;/legend&gt;
          {{#each option}}
              &lt;label for="regularCheckbox"&gt;
                  &lt;input type="checkbox" id="regularCheckbox" value="checkbox 1"&gt;
                  &lt;span&gt;{{this}}&lt;/span&gt;
              &lt;/label&gt;
          {{/each}}
      &lt;/fieldset&gt;
  &lt;/script&gt;
  &lt;script id="radio-template" type="text/x-handlebars-template"&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;{{label}}&lt;/legend&gt;
          {{#each option}}
              &lt;label for="regularRadio"&gt;
                  &lt;input type="radio" name="radios" id="regularRadio" value="radio 1"&gt;
                  &lt;span&gt;{{this}}&lt;/span&gt;
              &lt;/label&gt;
          {{/each}}
      &lt;/fieldset&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm trying to go down the list of objects and render the template based on the type attribute. Is this possible?</p>
  
  <p><code>If else</code> within the template didn't work out too well.</p>