How to set ui-select for readonly mode?

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

+5
source share
2 answers

Use ng-disabled instead of ng-readonly.

<ui-select ng-disabled="isReadOnly" ...> ... </ui-select> 
+6
source

If you need to view the options and disable text input, you can use the search option

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

Demo here

+1
source

All Articles