angularjs - Ionic checkbox check whether the checkbox is checked or not -
i use ionic checkbox below html
<ion-checkbox ng-repeat="ao in q.answeroptions" name="cb" ng-click="setansweroptionselected(q.id,ao.id)"> {{ao.text}} </ion-checkbox>
in controller need find out whether select check box checked or not . cannot use ng-model way finding out add property ao
isselected
and use in check box.
ng-model="ao.isselected"
can find out state of ionic checkbox whether checked or not in controller method in above code.
basically on call setansweroptionselected method should either able pass current ionic checkbox , check whether checked or not. ?
setansweroptionselected
i able find solution declaring dummy model on ng-init , passing value of variable parameter ng-click method.
<ion-checkbox ng-repeat="ao in q.answeroptions" name="cb" ng-change="setansweroptionselected(qg.id,q.id,ao.id,checkstatus)" ng-init='checkstatus=false' ng-model="checkstatus"> {{ao.text}} </ion-checkbox>
found solution post
Comments
Post a Comment