Bind two input checkbox to same model

Description

The following code shows how to Bind two input checkbox to same model.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<style>
    .ng-invalid { border: 1px solid red; }
</style><!--   ww  w .  j  a  v  a2  s . c o m-->
</head>
<body>
  <div ng-app>
  A - Check me to check both: 
    <input type="checkbox" ng-model="master"><br/>
  B - Check me to check both:
    <input type="checkbox" ng-model="master">
</div>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities