I'm trying to return a value to my $scope depending on if the checkbox is checked in angular JS but cannot seem to do so. Is there a way to get it to work?
HTML:
<div class=" specialClause col-md-10 " >
<label for="TAR">Tag Along Rights: <input type="checkbox" ng-model="TAR" ng-change="myFunc()" name="TAR" id="TAR"/></label>
JS:
$scope.dej= function(){
if($scope.TAR) {
console.log('TAR');
var tar = 'Yes';
}else{
console.log('no TAR');
var tar = 'no';
}
return tar;
};
but i cant access tar outside the function. Is there a way to the value of tar
's value outside the function?