GRowing GRowing - 1 year ago 87
AngularJS Question

Angularjs - Checkbox disabling and enabling

I am looking for a way to do exactly opposite from this example that was taken from angularjs ng-disabled documentation ...

In this example checking the box disables the button. I need exactly the opposite,,, I need the checked box to enable a disabled button. Can someone shed some light on this for me please.

<!doctype html>
<html ng-app>
<script src=""></script>
Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
<button ng-model="button" ng-disabled="checked">Button</button>


Answer Source

You can do:


The ! means to do the opposite, so !true == false = true


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download