I have a few buttons that work like switchers. If you click one it becomes active and \"shuts down\" other buttons. I did this using jQuery but would like to use AngularJS.
You can use
angular.element(document.querySelector("#cntrlID")).removeClass("customclass");
HTML:
Angular
$scope.removeNS = function(){
angular.element(document.querySelector("#normal")).removeClass("active");
angular.element(document.querySelector("#strong")).removeClass("active");
}
$scope.removeWS = function(){
angular.element(document.querySelector("#weak")).removeClass("active");
angular.element(document.querySelector("#strong")).removeClass("active");
}
$scope.removeWN = function(){
angular.element(document.querySelector("#weak")).removeClass("active");
angular.element(document.querySelector("#normal")).removeClass("active");
}
Further to optimize, you can just create a single function and pass the query selectors and class to remove as the function parameter, like:
function(id1,id2,removeClassName)