title: AngularJs How to filter ngRepeat with another array elements
body: <p>Is there any option to filter from <code>$scope.items</code> where the <strong>ID</strong> exist in the array <code>$scope.myitems</code> ?</p>
  
  <pre><code>ng-repeat="item in items | filter:{item.id == myitems}
  </code></pre>
  
  <p><strong>Demo: <a href="http://codepen.io/anon/pen/rOeGYB">http://codepen.io/anon/pen/rOeGYB</a></strong></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>angular.module('myapp', [])
    .controller("mycontroller", function($scope) {
      $scope.items = [
        {
          "id": 1,
          "name": "Melodie"
        }, {
          "id": 2,
          "name": "Chastity"
        }, {
          "id": 3,
          "name": "Jescie"
        }, {
          "id": 4,
          "name": "Hamish"
        }, {
          "id": 5,
          "name": "Germaine"
        }, {
          "id": 6,
          "name": "Josephine"
        }, {
          "id": 7,
          "name": "Gail"
        }, {
          "id": 8,
          "name": "Thane"
        }, {
          "id": 9,
          "name": "Adrienne"
        }, {
          "id": 10,
          "name": "Geoffrey"
        }, {
          "id": 11,
          "name": "Yeo"
        }, {
          "id": 12,
          "name": "Merrill"
        }, {
          "id": 13,
          "name": "Hoyt"
        }, {
          "id": 14,
          "name": "Anjolie"
        }, {
          "id": 15,
          "name": "Maxine"
        }, {
          "id": 16,
          "name": "Vance"
        }, {
          "id": 17,
          "name": "Ashely"
        }, {
          "id": 18,
          "name": "Dominic"
        }, {
          "id": 19,
          "name": "Cora"
        }, {
          "id": 20,
          "name": "Bo"
        }
      ];
      $scope.myitems = ['0', '3', '6', '10', '19']
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"&gt;&lt;/link&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app="myapp" ng-controller="mycontroller" class="container"&gt;
    &lt;h4&gt;My items&lt;/h4&gt;
    &lt;ul class="list-group"&gt;
      &lt;li class="list-group-item" ng-repeat="item in items | filter:{}"&gt;{{item.name}}&lt;/li&gt;
    &lt;/ul&gt;
    &lt;h4&gt;Total items&lt;/h4&gt;
    &lt;ul class="list-group"&gt;
      &lt;li class="list-group-item" ng-repeat="item in items"&gt;{{item.name}}&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>