I created a custom directive in angularjs:
directives.directive('myTop',function($compile) { return { restrict: 'E', templateUrl: 'views/header.html', } })
Directive Code:
<div class="my-header"> <button ng-click="alert('x')" class="fa fa-chevron-left"></button> <h1>SpeakZ</h1> </div>
for some reason, ng-click doesen't trigger.
I searched over the Internet and found that compiling / link is the solution to this problem, but I cannot find a working solution.
I do not use jquery ..
source share