I am trying to create a directive that will generate the current year for copyright. How do I access the year variable in the link of the directive? I've tried everything, but nothing works.
.directive('copyrightYear', function() {
return {
restrict: 'E',
link: function(scope, element) {
var date = new Date();
var year = date.getFullYear();
},
template: ''
};
})