Reputation: 259
I am trying to create a download function in my angularjs using a url link ( not a json ) For example: https://assets.onemap.sg/shp/historicsites.zip How can i do so ?
PS: Another question @the comment
<button ng-click="download">
</button>
Upvotes: 1
Views: 47
Reputation: 2807
Use download attribute in <a>
tag
<a href="https://assets.onemap.sg/shp/historicsites.zip" download>
If you want to change the url, do
<a ng-href="https://assets.onemap.sg/shp/{{fileName.zip}}" download>link1</a>
Upvotes: 1