Length of filtered array from ng-repeat inside ion-header


#1

Hi,

I have a ng-repeat directive inside my <ion-content> like this :

<ion-item 
ng-repeat="user in filtered_users = (users | filter: {type_user: 1}) track by user.id">
{{user.username}}
</ion-item>

I try to display the length of this filtered array inside the ion-header.
Above my ion-content, I put :

<ion-header-bar>Number of users :  {{filtered_users.length}} </ion-header-bar>

I initialize the array in my controller with $scope.filtered_users = []; but the header still displays 0 as the two scopes (ion-header and ion-content) were different. If I put {{filtered_users.length}} inside ion-content, it works correctly.

Here is a CodePen : http://codepen.io/anon/pen/LyqBNp

How can I do that ?

Thanks a lot

Rom