Convert .filter() to $scope function filter

Hello!
I am trying to convert a filter into a scope function so it will update when the scope changes. The filter code is reproduced below. By the way, the ng-repeat is on an <ion-item>.

    .filter('isInvolved', function() {
        // Create the return function and set the required parameter name to **input**
        return function(items, child) {

            var out = [];
            // Using the angular.forEach method, go through the array of data and perform the operation of figuring out if the language is statically or dynamically typed.
            for (var i = 0; i < items.length; i++) {
                var item = items[i];
                console.log("item: ", item);
                var students = item.students;
                console.log("students: ", students);
                for (k in students) {
                console.log("child: ", child);
                console.log("k: ", k);
                    if (child == k && students[k] === true) {
                        out.push(item);
                    }
                }
            }
            return out;
        };