<div class="input-group-btn">
  <button
      ng-if="elementtype && elementtype==='utilisateur'"
      ng-show="!autocomplete || editable==false"
      type="button"
      ng-model="selectedElement"
      class="btn btn-default"
      bs-options=" user.login as user.login for user in list | orderBy:'login'| filter:myfilter "
      ng-change="selectComponentChange(true)"
      placeholder="{{'tools.builder.components.title' | translate}}"
      ng-disabled="editable==false"
      bs-select
  ></button>
  <button
      ng-if="!elementtype || elementtype!=='utilisateur'"
      ng-show="!autocomplete || editable==false"
      type="button"
      ng-model="selectedElement"
      class="btn btn-default"
      bs-options=" r as r[attribute2display] for r in list | orderBy:attribute2display| filter:myfilter "
      ng-change="selectComponentChange(true)"
      placeholder="{{'tools.builder.components.title' | translate}}"
      ng-disabled="editable==false"
      bs-select
  ></button>


  <ui-select
      ng-if="elementtype && elementtype==='utilisateur'"
      ng-show="autocomplete && editable!=false"
      ng-change="selectFromAutocomplete(selectedAutocomplete)"
      ng-model="selectedAutocomplete.selected"
      theme="bootstrap"
      reset-search-input="false"
  >
    <ui-select-match allow-clear="true" placeholder="{{placeholder}}"
                     class="selected-value">{{$select.selected.login}}
    </ui-select-match>

    <ui-select-choices
        repeat="r in list | orderBy:'name'| filter:myfilter | filter:{ login: $select.search } track by $index"
    >
      <div ng-bind-html="translateName(r) | highlight: $select.search"></div>
    </ui-select-choices>
  </ui-select>


  <ui-select
      ng-if="!elementtype || elementtype!=='utilisateur'"
      ng-show="autocomplete && editable!=false"
      ng-change="selectFromAutocomplete(selectedAutocomplete)"
      ng-model="selectedAutocomplete.selected"
      theme="bootstrap"
      reset-search-input="false"
  >
    <ui-select-match allow-clear="true" placeholder="{{placeholder}}"
                     class="selected-value">{{$select.selected[attribute2display]}}
    </ui-select-match>

    <ui-select-choices 
      repeat="r in list | orderBy:attribute2display| filter:myfilter |   filter:{}[attribute2display] = $select.search track by $index">
      <div ng-bind-html="translateName(r) | highlight: $select.search"></div>
    </ui-select-choices>
  </ui-select>
</div>

<!--EXEMPLE VIERGE D'AUTOCOMPLETE-->
  <!--<ui-select
          ng-model="importFeature.fti"
          theme="bootstrap"
          title="Choose a person"
      >
        <ui-select-match
            placeholder="Select or search a person in the list..."
        >{{$select.selected.alias}}
        </ui-select-match>
        <ui-select-choices
            repeat="fti in ftis | orderBy:'alias' | filter:{ alias: $select.search }">
          <div ng-bind-html="fti.alias | highlight: $select.search"></div>
        </ui-select-choices>
      </ui-select>-->
