app.directive to create a new directive named
- The directive contains the three options
templateUrl that we saw before in the
- It also contains a fourth option
link is used to create interactive directives that respond to user actions.
The link function takes three inputs:
scope refers to the directive's scope. Any new properties attached to
$scope will become available to use in the directive's template.
element refers to the directive's HTML element.
attrs contains the element's attributes.
link function, there are two properties
installed, and the function
download(). We'll use these in the directive's template next.