6

Is it possible and how to make my ui-select readonly? Of course I've tried ng-readonly="isReadOnly" where I define in my controller $scope.isReadOnly=false; And of course I want to calculate it "in runtime" according to data from server that can change the state.

Alexander Vasilyev
  • 1,273
  • 2
  • 15
  • 22

2 Answers2

8

Use ng-disabled instead of ng-readonly.

<ui-select ng-disabled="isReadOnly" ...>
    ...
</ui-select>
Alexander Vasilyev
  • 1,273
  • 2
  • 15
  • 22
1

If you need to view the options and disable text typing, you can use search-enabled option

<ui-select search-enabled="false" ...> ... </ui-select>

DEMO here

Lucky_hunter
  • 486
  • 1
  • 5
  • 10