Q:

client side databinding with angular js

i got a piece of code of angular js for client side data binding. i am not familiar with angular js.
so here is the code
<html ng-app> 
<head> 
    <script src="scripts/angular.js"></script> 
    <script src="scripts/controller.js"></script> 
    <link href="Content/bootstrap.css" rel="stylesheet" /> 
    <title></title> 
</head> 
<body> 
    <div ng-controller="MainController"> 
        <div> 
            <h1>{{readingList.Name}}'s Reading List</h1> 
        </div> 
        <br /> 
        <div> 
            <table class="table table-bordered table-condensed" > 
                <thead> 
                    <tr> 
                        <th>Title</th> 
                        <th>IsComplete</th> 
                        <th></th> 
                    </tr> 
                </thead> 
                <tbody> 
                    <tr ng-repeat="book in readingList.Books"> 
                        <td>{{book.Title}}</td> 
                        <td>{{book.isComplete}}</td> 
                        <td><input type="checkbox" ng-model="book.isComplete" /></td> 
                    </tr> 
                </tbody> 
            </table> 
        </div> 
    </div> 
</body> 
</html>

var MainController = function ($scope) {

    var model = { 
        Name: "Madhur Kapoor", 
        Books: [{ Title: "The Hunger Games", isComplete: false }, 
                { Title: "The Alchemist", isComplete: true }, 
                { Title: "Angel & Demons", isComplete: false }, 
                { Title: "Da Vinci Code", isComplete: true }, 
                { Title: "The Godfather", isComplete: false } 
        ] 
    };

    $scope.readingList = model;

};

now my question is how check box will be checked or unchecked because check property is used to check unchecked the check box but if u see the code it look like <input type="checkbox" ng-model="book.isComplete" />
if angular add the check property to checkbox at run time then how angular js detect that controls is check box not radio button? please help me to understand how check property will be added to check box. very confusing. thanks

A:

When you assign an ng-model to an input, angular checks the type of that input and binds it to the correct attribute.
For checkboxes it will bind to the 'checked' attribute. For text it will bind to the underlying value.
More on the ng-model API: https://docs.angularjs.org/api/ng/directive/ngModel

