i\'ve created a custom directive in angularjs:
directives.directive(\'myTop\',function($compile) { return { restrict: \'E\', templateUrl: \'views/header.
Either use link as answered by @Ashesh or just simply add scope. If you set scope false you will not have isolated scope and click will work on directive.
directives.directive('myTop',function($compile) { return { restrict: 'EA', scope: false, templateUrl: 'views/header.html', } })