installApp II

We used app.directive to create a new directive named 'installApp'.

  • The directive contains the three options restrict, scope, and templateUrl that we saw before in the 'appInfo' directive.
  • It also contains a fourth option link. The link is used to create interactive directives that respond to user actions.

The link function takes three inputs:

  1. scope refers to the directive's scope. Any new properties attached to $scope will become available to use in the directive's template.
  2. element refers to the directive's HTML element.
  3. attrs contains the element's attributes.

Inside the link function, there are two properties buttonText and installed, and the function download(). We'll use these in the directive's template next.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.