Search code examples
angulartypescriptng2-bootstrap

Typeahead with Dropdown Functionality ng2-bootstrap


I've built in the ng2-bootstrap's Typeahead Component, but I need the field to drop down on click. Unfortunately the Dropdown Components do not support this. Is there any option (I have looked, but can't find) that allows you to have the Typeahead Component drop down like this? As if it's using Typeahead with an empty string search?

I should mention that I have tried the typeaheadMinLength option, and it allows the full list to show after backspacing your entry, but not on focus.

Current Code:

<input [(ngModel)]='filters.itemFilter' [typeahead]='items' typeaheadOptionField='name' typeaheadMinLength='0' class="form-control" placeholder='Items'/>

Any help would be appreciated.


Solution

  • you should try [typeaheadMinLength]="0" instead of typeaheadMinLength='0'. It worked for me.