title: filter: notarray error in angularjs
body: <p><a href="http://plnkr.co/edit/cJsScs8ixF1aq85Ri7nV?p=preview" rel="noreferrer">http://plnkr.co/edit/cJsScs8ixF1aq85Ri7nV?p=preview</a></p>
  
  <p>filter is not working. Other part of code also breaks. Throwing error filter:notarray. how it can be fixed     </p>
  
  <p>
      </p>
  
  <pre><code>&lt;head&gt;
    &lt;link rel="stylesheet" href="style.css"&gt;
  
  &lt;/head&gt;
  
  &lt;body ng-init="items=[3,1,2,3];"&gt;
    &lt;h1&gt;Hello Plunker!&lt;/h1&gt;
  
    &lt;div &gt;
  
    &lt;/div&gt;
    &lt;input type="text" ng-model="nm" /&gt;
  
  
  
    &lt;div ng-repeat="item in items track by $index | filter:nm" ng-hide="hide"&gt;
      {{item}}
  
    &lt;/div&gt;
  
    &lt;button ng-click="hide=!hide"&gt;Toggle &lt;/button&gt;
    &lt;button ng-click="items[items.length]=items.length"&gt;Add&lt;/button&gt;
  
  
    &lt;script src="https://code.angularjs.org/1.4.2/angular.min.js"&gt;&lt;/script&gt;
    &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>