0

I trying to implement a combo-box with bootstrap 3 dropodown, and set the button as triggering element for dropdown, like so (jade syntax below, "anguarExpression is my function tat wraps literal with {{ }} brackets, since jade "don't like" them):

div.input-group.input-group-lg.field.dropdown.choices-box
    span.input-group-addon(ng-if="glyphicon" title=angularExpression("title"))
        span.glyphicon(class=angularExpression("glyphicon"))
    span.input-group-addon(ng-if="!glyphicon")
        =angularExpression("title")
    input.value-holder(type="hidden")
    div(ng-transclude="ng-transclude")
    ul.dropdown-menu.choices-menu
        li(ng-repeat="choice in choices")
            a.choice-option(ng-click='selectChoice(choice)')
                span.option-icon.glyphicon(ng-if="choice.glyphicon", ng-class="option.glyphicon")
                span.option-text
                    =angularExpression("option.text")

Question is following: can i make tow-way binding te scope value to the button-value instead of binding the actual value to a hidden input/field?

Konstantin Isaev
  • 642
  • 8
  • 14
  • a fiddle could help illustrate your problem. also jade likes angular literals you just need to do `| {{title}}`. note the pipe. – Quad May 25 '14 at 13:43
  • I had troubles with jade when tried write something like value="{{value}} so i decided to use the helper function to wrap angular expressions for unification. Of course when it goes to ng-if or other similar directive where no extra brackets necessary, i write the expression literal directly like i do with ng-class="option.glyphicon". Thanks for pointing to jsfiddle – Konstantin Isaev May 25 '14 at 14:25

0 Answers0