I have a simple directive that toggles a class on an element, is it better to use $(this) or 'element' inside the function? (both work fine)
Here's the example:
.directive('test',['$rootScope',function($rootScope){
return {
restrict:'C',
link: function(scope, element, attrs){
return element.bind('click',function(){
element.toggleClass("active");
});
}
}
}])