You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to have a callback to this function that would be run when the resources have been changed? It might be that you want to do some more processing of the data when it has changed, and while you could run a watchCollection on the scope value that is set in the bindAll method that seems like a wasted watch.
The text was updated successfully, but these errors were encountered:
I can add that, but if you're wanting more control, couldn't you just do:
$scope.$watch(function(){returnDS.lastModified('post');},function(){$scope.posts=DS.filter('post',params);// do other processing on posts});
This is all that bindAll does internally. In addition, the above example lets you have a more advanced $watch and dynamic params, when you're doing pagination, for example.
varPAGE_SIZE=20;$scope.currentPage=0;$scope.$watch(function(){returnDS.lastModified('post')+$scope.currentPage;},function(){$scope.posts=DS.filter('post',{limit: PAGE_SIZE,skip: $scope.currentPage*PAGE_SIZE});// do other processing on posts});
I guess i could do that as well that is very true.
I have a kind of unrelated question but i will ask it here anyways, can you invalidate a resource so that any future findAll requestion to that resource won't hit the cache? Does ejectAll that resource also clear the query history?
That's a good point, ejectAll should clear the query history. You can pass an option to findAll called bypassCache and it will send the query to the server regardless of whether it has been made before.
Would it be possible to have a callback to this function that would be run when the resources have been changed? It might be that you want to do some more processing of the data when it has changed, and while you could run a watchCollection on the scope value that is set in the bindAll method that seems like a wasted watch.
The text was updated successfully, but these errors were encountered: