How to filter multiple dynamic values in angularJS
<p>Just like the question provider in <a href="https://stackoverflow.com/questions/15868248/how-to-filter-multiple-values-or-operation-in-angularjs">This</a> question, I am building a filter that filters on multiple values.</p>

<p>However, in my situation, I also want to have the filters created dynamically from an array.</p>

<p>So, for this example, instead of </p>

<pre><code>&lt;input type="checkbox" ng-model="genrefilters.action" /&gt;Action

&lt;input type="checkbox" ng-model="genrefilters.family" /&gt;Family
</code></pre>

<p>I want to ng-repeat like this to create the input boxes:</p>

<pre><code>&lt;div ng-repeat="distinctgenre in distinctgenres'"&gt;
    &lt;input type="checkbox" ng-model="genrefilters.distinctgenre"/{{distinctgenre}}
&lt;/div&gt;
</code></pre>

<p>However, when I do this, my filter, which is the same as in the original question:</p>

<pre><code>.filter('bygenre', function () {
return function (movies, genrefilters) {
    var items = {
        genrefilters: genrefilters,
        out: []
    };
    angular.forEach(movies, function (value, key) {
        if (this.genrefilters[value.genre] === true) {   // &lt;=== THIS LINE ERRORS OUT
            this.out.push(value);
        }
    }, items);
    return items.out;
};
</code></pre>

<p>Errors out, with TypeError: Cannot read property 'Action' of undefined.</p>

<p>I am using the filter like so.</p>

<pre><code>&lt;tr ng-repeat="movie in displayedmovies | byCohort:genrefilters"&gt;
    {{movie}}
</code></pre>

<p>Any assistance would be appreciated.</p>

<p>Thanks to dfsq for the reminder on bracket notation. That seems to be the main issue. (I also had some other dumb naming convention issues) </p>