I have the following element,
<button test-directive>value</button>
I know I can use the ng-click directive, but then I have to call a function from the controller. When the user clicks, I want to fire a directive called in example test-directive
testModule.directive('testDirective', function(){
return {
restrict: 'A',
link: function(scope, element, attrs) { }
}
})
how can I implement the ng-click in this directive?
Thank You
Not sure if I got your idea.
Here is the plunker