HTML
<tr ng-repeat="client in (filteredItems = (clients | filter:searchText | orderBy:sortingOrder:reverse))">
....
Controller:
function SomeController($scope,$http) {
$http.get("http://www.example.com/someapi", function(data) {
$scope.clients = data; // This code will cause a digest.
waitUtilDigestEnd() // I want to block it until the digest ends up so that $scope.filteredItems is up to date. How to write this code?
handle($scope.filteredItems)
})
}
function handle(filteredItems) {
.....
}
My question is how to re-calculate filteredItems variable to make filteredItems contains newest data.