The template uses Angular's built-in
ng-click directive. When the button is clicked,
ng-click will tell AngularJS to run the
download() function in the directive.
download() function uses the
scope.installed property to check if an app is installed. When an app is installed,
download() does three things:
- toggles the
- changes the button text to "Uninstall"