I am very new to creating AngularJs directive , so below i have created directive and when user click on delete button i am checking what are the values of scope,element and attrs but its not printing anything in console. ProcessDTO is the json data in the controller.
Any idea what i am missing here, i have read the directive documentation but if someone can put some light and explain it as beginner level it would be great.
html
<button class="btn btn-danger"
type="button" autodelete delete-tags="processDTO">Delete</button>
directive.js
angular.module('App').directive('autoDelete', function () {
'use strict';
return{
restrict:'A',
scope:{
autoDeleteTags: '=deleteTags'
},
link:function(scope,element,attr){
$(element).click(function(){
console.log('Element',element);
console.log('SCOPE',scope);
console.log('ATTRS',attr);
})
}
}
});