Using Jquery inside AngularJS directive good or bad idea?
问题 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. 回答1: You should not be using jquery as Angular itself has a lighter version for it known as