According to Ionic documentation, ion-item-option
have a href
attribute that sets hyperlinks or links.
Link of Documentation: ion-item-option: Ionic Framework API Docs
I used this type of method to list the Firebase Download URL of my files and when the user clicks ion-item-option
, the file explorer will open and downloading of file will be possible but unfortunately the button (ion-item-option) is unresponsive. Is there any way to do it?
I try the following to check if file.downloadUrl
is accessible or correct:
- I try the
<a href>
tags and this method is functional but I want to set theion-item-option
as a download button for my files.
html file
<ion-list>
<ion-item-sliding *ngFor="let file of files | async">
<ion-item detail>
<ion-icon name="document-attach-outline" slot="start"></ion-icon>
<ion-label>
<h2>{{ file.title }}</h2>
</ion-label>
</ion-item>
<ion-item-options>
<!-- This is the href attribute -->
<ion-item-option color="success" [href]="file.downloadUrl">
<ion-icon name="cloud-download" slot="icon-only"></ion-icon>
</ion-item-option>
<ion-item-option color="danger">
<ion-icon name="trash-bin" slot="icon-only"></ion-icon>
</ion-item-option>
</ion-item-options>
</ion-item-sliding>
</ion-list>