Hello, I need to use the id
I send from the view, the code of the switch is this:
<div ng-repeat="model in modelo_final">
<div style="float:left; padding-right:100px;">
<div class="can-toggle demo-rebrand-2">
<input id={{model.id}} type="checkbox" ng-model="idrecibo[model.id]" ng-change="changeItem()">
<label for={{model.id}}>
<div class="can-toggle__switch" data-checked="Yes" data-unchecked="No"></div>
<div class="can-toggle__label-text"><p style="font-size:15px; width:100px;">{{model.nombre}}</p></div>
</label>
</div>
</div>
</div>
which when being dynamic I send model.id
that corresponds to its id
respective, this I want to use it in the controller to be able to activate and deactivate the switch $scope.idrecibo = {};
Pressing the switch (activate) sends your id
. by console, and it would look something like this:
And if I activate another button:
which I would like it to be replaced, so always have one (the last one you activate) and that power to use it to tell my web services to activate the module or deactivate.
and another question, how can I get the true false from there? What is left only the number or how should I use it to send just the number?
Thank you.