1

I am using angular strap select box. But, I want to disable all the options of the selectbox, how do I achieve this?

$scope.itemsPerPageList = ['All','10','20','30','40'];

<select class="span2" 
     ng-init="itemsPerPage = itemsPerPageList[0]" 
     ng-model="itemsPerPage" ng-change="changePager()" 
     ng-options="obj as obj for obj in itemsPerPageList" 
     data-style="btn-primary" bs-select>
</select>

I tried using ng-disabled=true, but no luck.

1 Answer 1

1

It seems you are using AngularStrap v1.x, which is outdated and not supported anymore. In AngularStrap v2.x, select is done this way:

<button type="button" class="btn btn-default"
    ng-model="selectedIcon"
    data-html="1"
    ng-options="icon.value as icon.label for icon in icons"
    bs-select>
  Action <span class="caret"></span>
</button>

And ng-disabled=true works with it. Take a look at the doc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.