HangulSR
HangulSR

Reputation: 259

Angularjs download function using url

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

Answers (1)

Noor A Shuvo
Noor A Shuvo

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

Related Questions