How to put conditional class name inside helper /component element?
like this: i have {{input}} if certain condition is fulfilled it classname should be changed, i can do that with if outside,
is there anyway to make this one liner?
{{#if model.bar.errors.name.length > 0}}
{{input value=model.bar.name label='Bar Name' placeholder='The Name of Your Establishment' class=(model.bar.errors.name.length > 0 "color-" "blue")}}
{{#else}}
{{input value=model.bar.name label='Bar Name' placeholder='The Name of Your Establishment' class="field-error"}}
{{/if}}
Aucun commentaire:
Enregistrer un commentaire