Edit in JSFiddle

var app = angular.module('myApp',[]);

app.controller('angularJs',function($scope){
      $scope.name = 'ahmet'; 
});

app.directive('a',function(){
    return {
        restrict : 'E',
        template : '<h1>ahmet</h1>',
        controller : function($scope,$element){
            alert($scope.name+' controller');           
        },
        link : function(scope,elem,att){
            alert(scope.name+' link');   
        }
    };
});
<html ng-app="myApp">
    <body ng-controller="angularJs">
        <a></a>
    </body>
</html>