Ng-Checked-1

 

In this example of Ng-Checked, We have two checkboxes with same ng-model variable so if we check the checkbox then the other value will be checked and the vice versa. See the code

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app=""> <div class="container"> <label>Check both: <input type="checkbox" ng-model="master"></label><br /> <input type="checkbox" ng-checked="master"> </div> </body> </html>
Output