mardi 24 mars 2015

AngularJs + Checkbox Click Is Not Working + Appended Checkboxes

In my JS code, I am appending checkbox as per the selection of dropdown element. If I am selecting a element from dropdown, then at the same inline I am creating a checkbox of same name and disabling the element from dropdown because already showing in checkbox.


This is used to render HighCharts - Now i am trying to uncheck / check the Checkbox and trying on-change function to execute one Function but system is not calling that function.


Few Snippet of Code :-



var add_bpx = '<label class="check_btn"><input id="box" type="checkbox" ng-model="'+element+'" ng-change="runCheckedBox()" checked name="'+element+'" '+element+'</label>';
$('#input_row').append(add_box);


Output:-



<div class="input_row" id="input_row">
<label class="check_btn">
<input id="box" type="checkbox" ng-model="Box1" ng-change="runCheckedBox()" checked="" name="Box1">Box1
</label>
<label class="check_btn">
<input id="box" type="checkbox" ng-model="Box2" ng-change="runCheckedBox()" checked="" name="Box2">Box2
</label>
</div>


AngularJs:-



$scope.runCheckedBox = function(){
console.log('RunCheck Box executed');
}


Here Function is not calling .. Please help me out.





Aucun commentaire:

Enregistrer un commentaire