vendredi 22 juillet 2016

How to store valid ng-change event for checkbox in angularjs

I have multiple input text checkbox. I want to store the change box event in an array and later when user submits the Save changes, it should be saved.

<td><input type="checkbox" class="switch" ng-model="each_value.at_enable_flag" ng-change="changeMyArray(each_value)"> </td>

The problem with this is, if a user toggle the check box(On/ Off), it stores both the entries not only the latest one.

I tried to remove the duplicates but that is also having some issue.

Can anyone please help me out how I can store the cehckbox value in an array only if the checkbox original value has changed.

Here is my plunkr. Please have a look and let me know if u need any more details.

http://ift.tt/2a38Ppb




Aucun commentaire:

Enregistrer un commentaire