asp.net - Need to Get Checkbox value in AngularJS Controller, But Initially need checkbox to set to [Checked] -
my front code checkbox:
<asp:checkbox id="chkactive" ng-model="chkactive" ng-init="chkactive='true'" runat="server" text="active" checked="true" />
my angularjs controller code:
var _master = { unitcode: $scope.unitcode, unitname: $scope.unitname, chkactive: $scope.chkactive };
i need checkbox value in above chkactive variable, bu can get. me solve problem in such easy ways.
why don't use ng-checked
set checkbox checked? , call ngclick
function set checkbox value _master
variable
<asp:checkbox id="chkactive" ng-model="chkactive" ng-init="chkactive='true'" runat="server" text="active" ng-checked="chkactive" ng-click="clcheck()" /> $scope.clcheck = function(){ var _master.chkactive = $scope.chkactive }
Comments
Post a Comment