AngularJS - how to get an ngRepeat filtered result reference inside controller
<p>I am using an <strong>ng-repeat</strong> directive with filter like so:</p>

<pre><code> &lt;tr ng-repeat="entry in (filteredEntries = (entries | filter:hasGroup | filter:readingFilter | orderBy:data.sortType:data.sortReverse:true))"&gt;&lt;/tr&gt;
    &lt;span&gt;{{filteredEntries.length}}&lt;/span&gt;
</code></pre>

<p>I'm using $stateProvider to load views and controllers</p>

<pre><code>            $stateProvider
            .state('welcome', {
                url: "/",
                templateUrl: viewsPrefix + "welcome.html",
                data: {
                    pageTitle: 'Welcome'
                },
                controller: "WelcomeCtrl"
            })
            .state('data', {
                url: "/data",
                templateUrl: viewsPrefix + "data.html",
                data: {
                    pageTitle: 'Data'
                },
                controller: "DataCtrl",
            })
</code></pre>

<p>Here is a snippet from my controller:</p>

<pre><code>    .controller('DataCtrl', ['$scope', '$rootScope', '$state', '$translate', '$filter') {
$scope.filteredEntries = [];
$scope.entries = [1, 2, 3, 4, 5, 6,7];
$scope.hasGroup = function(){return true;}
$scope.readingFilter = function(){return true;}
setInterval(function () {
   console.log($scope.filteredEntries);
}, 500);
});
</code></pre>

<p>There is no problem with such a code, however I need to access filteredEntries attribute in my controller using <code>$scope.filteredEntries</code> which should be ok with no problem. Unfortunately this didn't work and I couldn't figure it out why this is happening.</p>