<ui-select ng-model="$ctrl.model">
  <ui-select-match placeholder="Select an environment">
    <span>{{ $select.selected.Name }}</span>
  </ui-select-match>
  <ui-select-choices group-by="$ctrl.groupEndpoints" group-filter="$ctrl.sortGroups" repeat="endpoint in ($ctrl.endpoints | filter: $select.search) track by endpoint.Id">
    <span>{{ endpoint.Name }}</span>
  </ui-select-choices>
</ui-select>
