I would be very grateful if anyone could help me with this since I am still new to this: Within a section of the page, where there are 5 buttons (come from a json), let me select several of those buttons, either one or all, have a style for active and another for inactive, then when clicked again, deselect (not disable) but stay with your inactive style.
moduloToc.controller('ctrlDatos', function($scope) {
$scope.estadoActivo = "btn btn-default";
$scope.estadoInactivo = "btn btn-info";
$scope.cambiarEstado = function(event) {
var idElemSel = "#" + event.target.id;
$(document).ready(function() {
if ($(idElemSel).click) {
$(idElemSel).addClass('activo');
} else {
$(idElemSel).removeClass('inactivo');
}
});
}
});
Thank you very much!