lundi 6 juillet 2015

How to observe for changes in the Ember data store?

I created this simple JsBin to demonstrate what I'm after.

JSBIN

I have some Fixture data and each item in it has a boolean property called isFavourite. The indexRoute just displays all the available data along with a second section that displays the items that are favourites. Each item also has a class binding to this isFavourite property. If it's a favourite, it'll have red text.

There is a second route called dashboard which only displays a subset of the data from the store. There is also a button to toggle the favourite property. When this is toggled, the change is reflected in the class binding on the index route but the Favourites section, which is just a repeater still shows the old data.

How do I establish a binding for the repeater so that the items change according to the isFavourite property?




Aucun commentaire:

Enregistrer un commentaire