Question:

How do you disable a button depending on a checkbox’s state?

Answer:

We can use the ng-disabled directive and bind its condition to the checkbox’s state.

<body ng-app>
	<label><input type="checkbox" ng-model="checked"/>Disable Button</label>
	<button ng-disabled="checked">Select me</button>
</body>

Keywords:

© 2017 QuizBucket.org