angularjs ui-select 如果select的内容为空 则禁止点击

 https://stackoverflow.com/questions/29534698/ui-select-disable-if-empty

I usually use ng-disable on myArray.length to get a 0 or !0 and use it as false and true. Always worked for me.

 ng-model="model.a"
   ng-options="value for a in array"
   ng-disabled="!array.length">

What about in your exemple :


    id="Models"
    ng-model="request.model"
    ng-disabled="!request.make.length">
 placeholder="Enter a Model…">{{$select.selected.name}}
 repeat="choice in request.make.models | filter: $select.search">
     ng-bind-html="choice.name | highlight: $select.search">

In your current code request.make would return [] and not 'false' ... if I understood well.

你可能感兴趣的:(AngularJs)