NejcZdovc / ng2-select2

Select 2 wraper for angular2
MIT License
123 stars 93 forks source link

Support <option> tags #66

Open achimha opened 7 years ago

achimha commented 7 years ago

The original select2 can work with <option> tags below it. Example:

<select id="foo">
  <option value="1">First option</option>
  <option value="2">Second option</option>
</select>

And then turn it into a select2 control:

$("#optimize").select2({ minimumResultsForSearch: -1 });

I think this control should support the same markup:

<select2 id="foo">
  <option value="1">First option</option>
  <option value="2">Second option</option>
</select2>

It could be easily done using <ng-content></ng-content>.

achimha commented 7 years ago

I have this basically working and will provide a PR once the current ones are in.

NejcZdovc commented 7 years ago

Ok, sound's good. Will merge current PR's today.

achimha commented 7 years ago

PR: https://github.com/NejcZdovc/ng2-select2/pull/67