title: Angular ng-select "No Items Found" error when typing in characters to filter
body: <p><a href="https://i.stack.imgur.com/qSPNM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qSPNM.png" alt="dropsown"></a></p>
  
  <p>I have a ng-select component whose drop-down items look like this image above.</p>
  
  <p>In an attempt to filter the list, I type in characters into the input control and see this: "No Items Found" despite the fact they are in the list.</p>
  
  <p><a href="https://i.stack.imgur.com/s0H3I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s0H3I.png" alt="enter image description here"></a></p>
  
  <p>Here's what I've done to try to figure this out...</p>
  
  <p>Within the component's own code, there is this filter function. I have found based on setting breakpoints, that there is no searchFn (according to code flow) so the defaultSearchFn is used but doesn't seem to work.</p>
  
  <pre class="lang-js prettyprint-override"><code>// Code within the component
  filter(term) {
          if (!term) {
              this.resetFilteredItems();
              return;
          }
          this._filteredItems = [];
          term = this._ngSelect.searchFn ? term : stripSpecialChars(term).toLocaleLowerCase();
          /** @type {?} */
          const match = this._ngSelect.searchFn || this._defaultSearchFn;
          /** @type {?} */
          const hideSelected = this._ngSelect.hideSelected;
  //Because there are no groups keys....
          for (const key of Array.from(this._groups.keys())) {
              /** @type {?} */
              const matchedItems = [];
              for (const item of this._groups.get(key)) {
                  if (hideSelected &amp;&amp; (item.parent &amp;&amp; item.parent.selected || item.selected)) {
                      continue;
                  }
                  /** @type {?} */
                  const searchItem = this._ngSelect.searchFn ? item.value : item;
                  //match is never called
                  if (match(term, searchItem)) {
                      matchedItems.push(item);
                  }
              }
  //code just skips to this point.
              if (matchedItems.length &gt; 0) {
                  const [last] = matchedItems.slice(-1);
                  if (last.parent) {
                      /** @type {?} */
                      const head = this._items.find(x =&gt; x === last.parent);
                      this._filteredItems.push(head);
                  }
                  this._filteredItems.push(...matchedItems);
              }
          }
      }
  </code></pre>
  
  <p>So no items are found because the itemslist.filteredItems is always null.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ng-select 
     #select
     (change)="onSelectChanged(select)"
     [(items)]="items"
     [searchable]="true"
     type="text"
  &gt;
     &lt;ng-template ng-label-tmp let-item="item"&gt;
        &lt;span class="dropdown"&gt;
           {{ item.firstName + " " + item.lastName }}
        &lt;/span&gt;
     &lt;/ng-template&gt;
     &lt;ng-template
        ng-option-tmp
        let-item="item"
        let-search="searchTerm"
        let-index="index"
     &gt;
        &lt;span class="dropdown"
           &gt;{{
              item.firstName +
                 " " +
                 item.lastName +
                 " " +
                 item.middleName +
                 " " +
                 "(" +
                 item.id +
                 ")"
           }}
        &lt;/span&gt;
     &lt;/ng-template&gt;
  &lt;/ng-select&gt;
  </code></pre>
  
  <p>Here's the HTML, have I forgot something to make the filtering work when characters are typed in?</p>