var app = angular.module("angularDirectiveModule", []);
app.controller("angularDirectiveController", ['$scope', function($scope) {
$scope.Name = "123"
}]);
app.directive("myStudent", function(){
return {
restrict:"EA",
template:"<h1>{{student}}</h2>",
controller:function($scope){
$scope.student = "hello directive";
}
}
});
<div ng-app="angularDirectiveModule" ng-controller="angularDirectiveController">
<h1>
{{Name}}
<my-student/>
</h1>
</div>