Hi,
I have one checkbox
By default i have checked that checkbox
if i am trying to save without touching that checkbox it was saving 0 value as per as my requirment i need to display 1 value
Could you please help me
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.Save = function () {
debugger;
var LeaveType = { Active: $scope.Active };
alert(LeaveType);
}
});
</script>
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<input type="checkbox" ng-checked="true" ng-model="Active" />
<div><input type="button" ng-click="Save()" value="Save" /></div>
</div>
</body>
</html>