javascriptangularjsangular-strap

mgcrea.ngStrap.select onSelect callback isn't working


I'm using angular strap mgcrea.ngStrap.select (http://mgcrea.github.io/angular-strap/#/selects)

I'm trying to use onSelect callback but the callback never called,
I tried using the following:

<button type="button" class="btn btn-default" 
    on-select="selectCallback" 
    ng-model="selectedIcons" data-html="1" data-multiple="1" 
    data-animation="am-flip-x" bs-options="icon.value as icon.label for icon in icons" bs-select>
      Action <span class="caret"></span>
    </button>

I prepared a small plunkr which demonstarte the issue: http://plnkr.co/edit/jJvCF7qVvBrVSFK5RVN3?p=preview


Solution

  • The way to use the callback is using bs-on-X, e.g.:

    bs-on-select="selectCallback"
    

    Full example:

    <button type="button" class="btn btn-default"
    bs-on-select="selectCallback" 
    ng-model="selectedIcons" data-html="1" data-multiple="1" 
    data-animation="am-flip-x" bs-options="icon.value as icon.label for icon in icons" bs-select>
      Action <span class="caret"></span>
    </button>