I am facing an issue with using a filter on my ng-repeat that involves a function with a parameter passed in, but for some reason, the filter is not working as expected.
The function I am using for the filter compares two arrays to find any matching elements and then returns true or false based on the comparison.
$scope.ifinfav1 = function(f){
return e.indexOf(f) !== -1;
};
Below is the HTML code where the filter is being implemented.
<ion-view view-title="Favourites">
<ion-content>
<ion-list>
<ion-item id="fav" class="item-icon-right" collection-repeat="office in offices|filter:ifinfav1(office.id)" ng-controller="ModalCtrl" ng-click="openModal(office.id); lastview(office.id);">
<p>{{office.id}}</p>
<p id="details">{{office.LocAddressLine1 + ", " + office.LocAddressLine2 + ", " + office.LocCity + ", " + office.LocCountryDescription + ", " + office.LocZipPostalCode}}</p>
<i ng-class="{'icon ion-android-star': liked(office.id), 'icon ion-android-star-outline': liked(office.id)}" ng-click="togglefav(office.id); $event.stopPropagation();"></i>
</ion-item>
</ion-list>
</ion-content>
</ion-view>