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? \"
o
You should not be using jquery as Angular itself has a lighter version for it known as jqlite.
More documentation on JQLITE
So your directive should look like:
outsource.directive('dedicated', function(){
return {
restrict: 'E',
link: function(scope, element, attribute){
var elem = angular.element(document.querySelector('#klik'))
angular.element(elem).triggerHandler('click');
},
replace: true,
templateUrl: 'src/app/components/views/dedicated-prices.html'
};
});