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

Technology CommunityCategory: AngularJSHow do you disable a button depending on a checkbox’s state?
VietMX Staff asked 3 years ago

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>