AngularJS ng-checked example

AngularJS ng-checked sets the checked attribute on the element, if the expression inside ng-checked is true.

<div ng-app="myApp" ng-controller='MyCtrl'>
  Master checkbox<input type="checkbox" ng-model="master"><br>
  Selecting above select this checkbox also: <input type="checkbox" ng-checked="master"><br>
</div>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
<script>
  var module = angular.module('myApp', []);
  module.controller('MyCtrl', function($scope) {});
</script>
refresh
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments