ng2-select2-demo
ng2-select2-demo copied to clipboard
Placeholder Not Working in single Select
Hi, I have tried giving placeholder in Select2 Options but it doesn't work multiple is set to false however if multiple is set to true, then placeholder works.
I have also viewed in demo and there are no demos which shows Placeholder in single Select.
Also, in single select, by default first option is selected, however value is not selected i.e value is empty.
This is my options var -
public options: Select2Options = {
minimumResultsForSearch: 9001,
placeholder: 'Select project...',
};
Thanks.
What worked for ma as quick-and-dirty fix was to first push an item with empty strings to the data array:
{id: '', text: ''}
This enables the placeholder for me so far.
This module support, but dont have documentation. Here is my finding which can help others
<select2 [options]="{placeholder:'Your Select placeholder'}"