<template>
  <div class="btn-group" uib-dropdown>
    <button id="single-button" type="button" class="btn btn-sm btn-default" uib-dropdown-toggle>
      {{$ctrl.label}}: <i>{{$ctrl.currentSelection || $ctrl.defaultValue}}</i> <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
      <li role="menuitem" ng-repeat="selection in $ctrl.selectionList track by $index">
        <a href ng-click="$ctrl.select(selection)">{{selection}}</a>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'ml-select'
};
</script>
