2017-07-26 1 views

Antwort

1

Gehen Sie folgendermaßen vor:

1. Add ng-hide directive to your anchor tag. Example ng-hide="hideLink" 
2. Call a function on click of download link. Example ng-click="downloadLinkClicked()" 
3. Within the function, set $scope.hideLink = true; 
4. Your download link will be hidden now. 

Code-Snippet:

In Sie HTML

<a ng-href = "{{myCtrl.fileUrl}}" download = "{{myCtrl.file}}" ng-hide="hideLink" ng-click="downloadLinkClicked()"> 
    {{myCtrl.file}} 
</a> 

In Ihrem js Controller:

$scope.hideLink = false; 
    $scope.downloadLinkClicked = function() { 
     $scope.hideLink = true; 
    } 
+0

Tipp: Sie können sogarhinzufügenneben Anker-Tag und Aufruf closeLink() -Funktion bei Klick darauf. –

+0

Können Sie mehr Details bearbeiten und anzeigen? Ich bin Anfänger in angularjs. –

+0

Sehen Sie, ob das hilft? –