lordfriend / nya-bootstrap-select

An AngularJS select replacement which build select like dropdown component with collection and ng-model support
http://nya.io/nya-bootstrap-select/
MIT License
178 stars 81 forks source link

Compiling content of the button before appending it #131

Closed szan closed 8 years ago

szan commented 8 years ago

When option links contain custom content with some added expressions or directives (e.g. ng-style or ng-class) the button should also copy the behavior.

lordfriend commented 8 years ago

I'm wondering why this is needed, ngStyle and ngClass should work in your nya-bs-option directive without extra work just like this example http://nya.io/nya-bootstrap-select/#!/examples/custom-content

szan commented 8 years ago

It works until you change something that is bound to the directive. $index from the example never changes dynamically. For example:

I'm currently designing a form control for inserting content in multiple languages. There's an indicator in each option that turns green when given translation is present. Like here: zrzut ekranu 2016-05-20 o 15 35 18

Indicator color is set by the ngClass directive and depends on the external value. The problem occurs when i start typing and while option link in the dropdown correctly turns green, the button view remains unchanged. This is a bit inconsistent. zrzut ekranu 2016-05-20 o 15 50 51

Maybe I'll try to create a jsfiddle that describes the problem on a simpler example if it helps.

lordfriend commented 8 years ago

Well, I have understood your need.

szan commented 8 years ago

Thanks for your help and the quick response!