Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Accessing $select

user378230 edited this page Jun 9, 2016 · 4 revisions

Many requests for custom features can be satisfied by accessing the uiSelectController in your own custom directive.

To do this, create a directive of your own which requires the uiSelect directive, like so:

myModule.directive('myUiSelect', function() {
  return {
    require: 'uiSelect',
    link: function(scope, element, attrs, $select) {
      
    }
  };
});

Using it like so:

<ui-select my-ui-select ng-model="person.selected">
  <ui-select-match> ... </ui-select-match>
  <ui-select-choices> ... </ui-select-choices>
</ui-select>

Refer to the source code of uiSelectController to see what is functionality is available through this API.

If you feel your directive may be useful to others, feel free to submit it is as a Pull Request for consideration for inclusion in the library.

Examples

  1. Select active item on Blur
  2. Placeholder Always Visible

Clone this wiki locally