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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -