I am using angular js. And implementing input checkbox, So this checkbox checked by default from angular controller using ng-model:
Controller:
var checkBoxVal = true;
$scope.checkboxModel = {
value : checkBoxVal,
}
$scope.call = function(){
alert("--comes--");
if($scope.checkboxModel== false)
{
}
if($scope.mycheckbox== true){
}
}
HTML:
<input type="checkbox" ng-model="checkboxModel.value" data-ng-change="call();"/>
But when call the function "call()" then it is not coming in if condition because $scope.checkboxModel is undefined. When I use only ng-model="checkboxModel" then it is coming in if condition with true and false. But I want to use both set true value in like ng-model="checkboxModel.value" and compare the checkbox value after calling the call() function.