Problem with binding model in loop


#1

I’m having an issue with data from my model not being bound. The category in the first each loop is bound fine. If I make a change to the input box, my model reflects that change.

The problem appears to be in the inner each loop. None of my changes in the inner loop are reflected in the model. If I change the inner loop to be just {{#each descriptions}} and use {{this}} instead of {{description}} my model still doesn’t reflect the changes.

{{#each amenities}}
    {{input type="text" value=category}}
    <div><label>{{category}}</label></div>
    <ul class="sortable-amenities" style="list-style-type: none;">
    {{#each description in descriptions}}
        <li>
            <div>
                <span class="handle glyphicon glyphicon-move pull-left" style="margin-top: 15px; margin-right: 10px;"></span>
                {{input type="text" class="form-control input-amenities" name="amenity-description" placeholder="Amenity" value=description}}
                <button style="padding-top: 3px;" {{action 'removeAmenity' description}}><span class="glyphicon glyphicon-remove" style=""></span></button>
            </div>
        </li>
    {{/each}}
    </ul>
{{/each}}

Jsbin: http://jsbin.com/yanifonure/1/


#2

Sample data:

“amenities”: [ { “category”: “Featured”, "_id": “53dc0aeede4be108724ce46a”, “descriptions”: [ “Floor Plans”, “Pool”, “Fitness Centre”, “Air Conditioning”, “Care Centre”, “Pets” ] }, { “category”: “Extra Features”, "_id": “53dc0aeede4be108724ce469”, “descriptions”: [ “Three places”, “Connections”, “Appliances”, “Breakfast”, “Bright rooms”, “Marble Flooring”, “Ponds”, “All Windows”, “Organizers” ] }, { “category”: “Community”, "_id": “53dc0aeede4be108724ce468”, “descriptions”: [ “Picnic”, “Basketball”, “Volleyball”, “Playground”, “School”, “Maintenance”, “Customer”, “Business” ] } ]