Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular js bootstrap button disable

I have the following angularjs app html file:

<button class="btn btn-default pull-right" ng-click="open(subcategory)">Add Course <span class="glyphicon glyphicon-plus"></span></button>

I would like to know if we can disable the Add course button whenever the condition required credits == completed credits is met. The controller is a regular json file with all the parameters in the subcategories.

Please help!

like image 724
Abhishek Avatar asked Apr 01 '14 04:04

Abhishek


1 Answers

Use the ng-disabled directive

<button class="btn btn-default pull-right" ng-disabled="subcategory.required2 == subcategory.completed2" ng-click="open(subcategory)">Add Course <span class="glyphicon glyphicon-plus"></span></button>
like image 197
ricick Avatar answered Oct 29 '22 07:10

ricick