ng2-select2-demo icon indicating copy to clipboard operation
ng2-select2-demo copied to clipboard

how to set the default value

Open naveedshahji opened this issue 4 years ago • 2 comments

I want to show the first value of my list instead of placeholder

naveedshahji avatar Mar 21 '20 11:03 naveedshahji

@naveedshahji were you able to do it?

fadelafuente1 avatar Jun 23 '20 18:06 fadelafuente1

This is the way to do it @naveedshahji

select2.currentSelection = 'id';
select2.startingOptions = [{
        id: 'id',
        text: 'currentSelection'
}];

fadelafuente1 avatar Jun 23 '20 21:06 fadelafuente1