title: AngularJS Filter Select array
body: <p>I have a select that looks like this</p>
  
  <pre><code>&lt;select
      class="form-control"
      ng-model="vm.transaction.location_from"
      ng-options="l.name for l in vm.locations"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>with <code>vm.locations</code> sourcing from the following JSON:</p>
  
  <pre><code>[
    {
      "id": "c0d916d7-caea-42f9-a87f-a3a1f318f35e",
      "name": "Location 1"
    },
    {
      "id": "d8a299a3-7f4b-4d32-884f-efe25af3b4d2",
      "name": "Location 2"
    }
  ]
  </code></pre>
  
  <p>Further, I have another select that looks like:</p>
  
  <pre><code>&lt;select
      class="form-control"
      ng-model="vm.transaction.item"
      ng-options="i.name for i in vm.items"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>with <code>vm.items</code> sourcing from the following JSON:</p>
  
  <pre><code>[
    {
      "id": "9f582e58-45dd-4341-97a6-82fe637d769e",
      "name": "20oz Soft Drink Cup",
      "locations": [
        {
          "inventory_id": "9d5aa667-4a64-4317-a890-9b9291799b11",
          "location_id": "c0d916d7-caea-42f9-a87f-a3a1f318f35e"
        },
        {
          "inventory_id": "9d5aa667-4a64-4317-a890-9b9291799b11",
          "location_id": "d8a299a3-7f4b-4d32-884f-efe25af3b4d2"
        }
      ],
    }
  ]
  </code></pre>
  
  <p>I want to, on change of the <code>ng-mode="vm.transaction.item"</code> select, have the <code>ng-model="vm.transaction.location_from"</code> be filtered to only show values that match from the <code>locations</code> array. I know I can use a <code>| filter: { }</code>, but I'm not sure what that filter should look like.</p>