Here is a codepen http://codepen.io/shirha/pen/BNBxWJ/ to better show my question.
First notice on the recipes tab that Briar Heart shows on multiple rows.
Now navigate to the ingredients tab and uncheck Briar Heart.
And then tab back to the recipes tab and notice that all the Briar Heart recipes have been removed (thanks to the filter:available
).
Now go to the options tab and click refresh ingredients.
The recipes tabs includes Briar Heart again. Notice that clicking the Briar Heart ingredient button on the recipe tab also unchecks the ingredient and removes the recipes.
If you now change the link to the ionic-bundle.js
to 1.0.0-rc.3
and perform the same steps, you will notice that the recipes tab will not refresh without scrolling forward past the buffer specified on the collection-repeat.
I've tried to code an scope.$apply()
to work around this but I don't know how to do this and have been unsuccessful so far. I'm not sure if this is the right idea.
I think in your case the best option is to disable the view caching. The view will get cached (even if the state changes in the background) and not immediately updated. You will notice if you follow your steps above, but then click on another item on the recipes view (when Brian Heart still shows, but shouldn't be) it will also update the scope and the view will reflect the correct changes. Here is and updated working codepen http://codepen.io/gnomeontherun/pen/KpPLop?editors=001.
.config(function($ionicConfigProvider) {
$ionicConfigProvider.views.maxCache(0);
})