lundi 1 juin 2015

set a predetermined value on Emberjs input

So I have a dynamically generated form:

<form {{action 'submit' on="submit"}}>
    {{#each model.product.variants as |variant|}}
        <div class="single-product-option-wrapper">
            <div class="row">
                <div class="col-sm-2">
                    <div class="radio">
                      <label>
                        {{input value=optionValue value="{{variant.id}}" type="radio"}}
                        {{model.product.name}}
                      </label>
                    </div>
                </div>
            </div>
        </div>
    {{/each}}
    <button>Submit</button>
</form>

as you can see I'm trying to set the checkbox with the binding of optionValue with what ever the value of {{variant.id}} is. How can I set that value? I'm I just going about it completely the wrong way?




Aucun commentaire:

Enregistrer un commentaire