Below you can see my code for the directive.
My question is: " Can i use jquery with directives? Is that a good idea? If not why? "
outsource.directive('dedicated', function(){
return {
restrict: 'E',
link: function(scope, element, attribute){
$("#klik").click(function(){
alert('works');
});
},
replace: true,
templateUrl: 'src/app/components/views/dedicated-prices.html'
};
});
P.s this code works.
jQuery. I've seen on many SO topics that people are more like to choose to useAngularJSorjQuery, but not both. AddingjQueryto directing is "not that bad" (not the best choice anyways) but it does add another dependency...