AngularJs Check All Uncheck All
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.Items = [{ Name: "Item 1" }, { Name: "Item 2" }, { Name: "Item 3" }, { Name: "Item 4" }, { Name: "Item 5" }, { Name: "Item 6" }, { Name: "Item 7" },{ Name: "Item 8" }]; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <table> <tr> <td><input type="checkbox" ng-model="selectedAllItem" />Select All Items </td> </tr> <tr ng-repeat="item in Items"> <td>{{item.Name}} <input type="checkbox" ng-model="selectedCheckboxes['{{$index}}']" ng-checked="selectedAllItem" /> </td> </tr> </table> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.Items = [{ Name: "Item 1" }, { Name: "Item 2" }, { Name: "Item 3" }, { Name: "Item 4" }, { Name: "Item 5" }, { Name: "Item 6" }, { Name: "Item 7" },{ Name: "Item 8" }]; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <table> <tr> <td><input type="checkbox" ng-model="selectedAllItem" />Select All Items </td> </tr> <tr ng-repeat="item in Items"> <td>{{item.Name}} <input type="checkbox" ng-model="selectedCheckboxes['{{$index}}']" ng-checked="selectedAllItem" /> </td> </tr> </table> </div> </div> </body> </html>
Copyrights@tutorialsplane.com