AngularJS Directive for downloading excel file
<p>I have the following HTML code in my AngularJS- application:</p>

<pre><code>&lt;a href="/api/schedulerecordexcel/{{vm.reportInstitution.id}}/{{vm.reportUser.id}}/{{vm.reportYear}}/{{vm.reportMonth}}"&gt;&lt;img src="./Excel.PNG" alt="excel" /&gt;&lt;/a&gt;
</code></pre>

<p>and this works fine. I need this code very often, therefore I decided to make a directive but I have almost no experience in making directives. 
This is my first approach:</p>

<pre><code>(function() {
'use strict';

angular
    .module('myApplication.common')
    .directive('asExcelDownload', asExcelDownload);

function asExcelDownload() {
    var directive = {
        restrict: 'E',
        link: link
    };

    return directive;

    ////////////

    function link(scope, element, attrs) {
        // TODO
    }
}
})();
</code></pre>

<p>Can give me someone any hint if I am doing right and what to do in the link function (if this function is ok)?</p>