jeudi 19 mars 2015

Ember template not updating when new record is saved

I have a simple template, whose route assigns a collection of price points as the model. In the template, I iterate through these and output the amounts:



{{#each pricePoint in controller}}
li.bar-levels__value ${{pricePoint.amount}}
{{/each}}


In this same template there's a form to create a new PricePoint. It calls an action which is handled in the controller and creates and saves a record:



this.store.createRecord('pricePoint', {
brandCode: property.get('brandCode'),
propertyNumber: property.get('propertyNumber'),
amount: parseFloat(this.newValue)
}).save();


This works correctly in that it saves the record via my REST API and on a page refresh I can verify that it appears in the list of pricePoints. But why doesn't the list update in real-time, ie. when I save the record successfully? It worked this way before I made the switch from a FixtureAdapter to a RESTAdapter...


Please help!





Aucun commentaire:

Enregistrer un commentaire