Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add custom attributes to <select> options generated with Angular's ng-options

With Bootstrap, you can very nicely define tooltips for <select> options (stackoverflow.com), while Angular can conveniently generate and bind options with the ngOptions attribute on a <select> element.

However, how can I add attributes to these generated option elements that can then be used by Bootstrap's tooltip plugin?

like image 294
Benny Bottema Avatar asked Nov 07 '25 18:11

Benny Bottema


1 Answers

Looking at the source code of AngularJS in its current version (1.0.4 and 1.1.2) it is not possible as option elements are created inside JavaScript code without possibility to specify any additional attributes.

like image 68
pkozlowski.opensource Avatar answered Nov 09 '25 17:11

pkozlowski.opensource



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!