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>
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>
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>
downloadattribute:<a href="https://assets.onemap.sg/shp/historicsites.zip" download>urlthen assignURLin a variable and bind it in ahrefattribute.