title: AngularJs conditional display for ng-options
body: <p>I've been searching for a few hours now and I can't seem to find the answer for my problem anywhere. I remember that I was able to implement it before but for some reason I lost the code and I can't seem to remember what I did to make it work.</p>
  
  <p>I'm trying display data from an array in a select box using ng-options. That one I have no problems with. What I need to implement is that only certain array values will be displayed/included in the select box.</p>
  
  <p>My data is as follows:</p>
  
  <pre><code>$scope.chartList = [ { "id" : 1, "name" : "chart 1", "order" : 1, "active" : false },
                       { "id" : 2, "name" : "chart 2", "order" : 2, "active" : true },
                       { "id" : 3, "name" : "chart 3", "order" : 3, "active" : true },
                       { "id" : 4, "name" : "chart 4", "order" : 4, "active" : true }, 
                       { "id" : 5, "name" : "chart 5", "order" : 5, "active" : true } ];
  </code></pre>
  
  <p>And my HTML looks like:</p>
  
  <pre><code>&lt;select ng-model="toAddChart" ng-options="chart.id as chart.name for chart in chartList | filter:chart.active=='false'"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>So what I want to happen is that if the value of the attribute "active" is false then it's the only time the array item will be displayed/included in the select list. I've tried different permutations of the filter attribute but none seem to work.</p>
  
  <p>I know I can easily use ng-repeat in the  tag and use ng-show but I remember reading somewhere (again, I can't find where) that it's not the proper way to implement it and that using ng-options is the correct way.</p>
  
  <p>I'm really really sure I was able to do it before without creating a custom javascript filter, but for the life of me I can't remember how I did it. I'm hoping someone can</p>
  
  <p>Hope someone can help me with this because I'm out of ideas.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Great scott, I think I've got it.</p>
  
  <p>Instead of:</p>
  
  <pre><code>filter:chart.active=='false'
  </code></pre>
  
  <p>It should be:</p>
  
  <pre><code>filter:chart.active='false'
  </code></pre>
  
  <p>It's just the number of equal signs used. <em>facepalm</em></p>
  
  <p>Thanks for the responses, everyone.</p>