title: Cant get Angular custom filter to work
body: <p>So the intent is to show specific words based on their "quarters". Something is wrong with $scope.myFunc because when I try to select a checkbox instead of showing the corrosponding words I get "undefined is not a function". Does anyone know what it could be?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> var app = angular.module("sight", []);
  
   app.controller('WordController', function($scope){
    
   $scope.myFunc = function(a) {
          for(catagory in $scope.catagoryArray){
              var c = $scope.catagoryArray[catagory];
              if(c.on &amp;&amp; a.quarter.indexOf(c.area) &gt; -1){
                  return true;   
              }               
          }
      };
  
     $scope.catagoryArray = [{ area: 'colors', on: false}, { area: "numbers", on: false}, { area: "first", on: false}, { area: "second", on: false}, { area: "third", on: false},{ area: "fourth", on: false}];
  
    $scope.words = [
     { 
    name: 'Red',
    sound: "audio/test.mp3",
    quarter: ['colors']
    },
     { 
    name: 'White',
    sound: "audio/test.mp3",
    quarter: 'colors'
    },
     { 
    name: 'Blue',
    sound: "audio/test.mp3",
    quarter: 'colors'
    },
     { 
    name: 'Yellow',
    sound: "audio/test.mp3",
    quarter: 'colors'
    },
     { 
    name: 'Black',
    sound: "audio/test.mp3",
    quarter: 'colors'
    },
     { 
    name: 'Green',
    sound: "audio/test.mp3",
    quarter: 'colors'
    },
   { 
    name: 'One',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Two',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Three',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Four',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Five',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Six',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
       {
    
    name: 'Seven',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Eight',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
       {
    name: 'Nine',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'Ten',
    sound: "audio/test.mp3",
    quarter: 'numbers'
    },
     {
    name: 'am',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'and',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'are',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'at',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'can',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
    {
    name: 'do',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'for',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'go',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'have',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'he',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
      {
    name: 'here',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'I',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'is',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'it',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'like',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
      {
    name: 'look',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'me',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'my',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'no',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'play',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'said',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'see',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'she',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'the',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
      {
    name: 'to',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'up',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'we',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'will',
    sound: "audio/test.mp3",
    quarter: 'one'
    },
     {
    name: 'you',
    sound: "audio/test.mp3",
    quarter: 'one'
    },   
     {
    name: 'secondtest',
    sound: "audio/test.mp3",
    quarter: 2
    },   
     {
    name: 'thirdtest',
    sound: "audio/test.mp3",
    quarter: 'third'
    },   
     {
    name: 'will',
    sound: "audio/test.mp3",
    quarter: 'fourth'
    }];
     });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
   &lt;body  ng-app="sight"&gt;
    &lt;h4&gt;If you don't want to practice all of the words, please choose the quarter or types you want to practice. You can choose more than one.&lt;/h4&gt;
    &lt;div ng-controller="WordController"&gt;
  &lt;li ng-repeat="area in catagoryArray"&gt; 
    &lt;label&gt;
      &lt;input type="checkbox" ng-model="area.on"&gt;{{area.area}}
    &lt;/label&gt;{{area.on}}
  &lt;/li&gt;
    &lt;h1&gt;Words&lt;/h1&gt;
    &lt;ul&gt;
      &lt;li ng-repeat="word in words | filter:myFunc"&gt;{{word.name}}&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
    &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>