Reputation: 16748
I've got a link which is supposed to execute an action and initiate a download.
However as soon as an {{action}}
ist set the href
attribute is suppressed.
<a {{bind-attr href=download.filepath}} {{ action "incDownload" }}>
{{ download.name }}
</a>
How can I make this work?
Upvotes: 0
Views: 196
Reputation: 4434
Pass the filepath as a parameter to the action instead and initiate the download in the action.
<a {{ action "incDownload" download.filepath }}>
{{ download.name }}
</a>
and then your action will have access to the filepath:
incDownload: function(filepath){
// do stuff
// peform the download
window.location = filepath;
}
Upvotes: 2