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

Accessing $select

Tinomuchenje edited this page Aug 1, 2019 · 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, as shown below:

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

Using it as illustrated below:

<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