Disable text input by checkbox

Description

The following code shows how to Disable text input by checkbox.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from  ww  w .ja va  2  s .c  o m-->
<body>
  <div ng-app>
    <form>
        <input type="checkbox" ng-model="redirect" checked="checked">
        <input type="text" ng-disabled="redirect==false">
    </form>
</div>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities