It should already be available inside the link function
app.factory('factoryProvider', function(){
return {
name: 'my Name'
}
});
app.directive('myDiv',['factoryProvider', function(factoryProvider) {
return {
restrict: 'E',
replace: true,
template: '<p>{{name}}</p>',
controller: function($scope) {
},
link: function(scope) {
scope.name=factoryProvider.name;
}
};
}]);