I’m trying to figure out how to cause the refresher to trigger programatically. For example, a user does something that updated the backend. I need to trigger a refresh.
I don’t see anything in the code for actually triggering the effect. I can imagine something like triggering a Gesture, but that code is over my head. Suggestions?
Never mind. I found the smarter way to do this. My model should be updating when the cache gets refreshed in my service. So, now that I’m properly doing this, my list updates automatically.
I’ve been using angular-cache and having the cache expire every 30 seconds. It supports an onExpire callback that lets me update the cache in the background. I use $rootScope.$broadcast in the cache call back to let my controller know there’s updated data. I then use $scope.$on to listen for that broadcast on my controller to let it know it needs to fetch new data.
Sorry, I know you asked @Calendee, but I wanted to share my 2 cents and possibly get feedback.
And that should work just fine like in my example.
However, I think I see your problem. You are not using “dot notation”. Try changing $scope.teams = data to $scope.data.teams = data and then updating your binding in your HTML.