Can someone help me with creating a directive that can automatically generate the current year for a copyright notice? I'm struggling to figure out how to access the year variable in the link function of the directive. I have tried several methods, but nothing seems to be working.
.directive('autoCopyright', function() {
return {
restrict: 'E',
link: function(scope, element) {
var currentDate = new Date();
var currentYear = currentDate.getFullYear();
},
template: ''
};
})