I know how to do this with jQuery, but what is the best way to do it with Angular?
Atm I am doing this:
app.directive('activeRadio', function() {
return function(scope, element) {
element.find('input.alt-radio').on('click', function(e){
var input = $(e.currentTarget);
input.parent('label').addClass('active').siblings('label').removeClass('active');
});
};
});
But it is adding/removing the active class on clicks, which may not be optimal.
I read something about ng-model=“checked”, can I use that doing this?