1

I have an AngularJS SPA with Html5Mode enabled. I removed the hashes from my URLS and everything works great except for one issue. Our site has download links for downloading documents from the server via a HTTPGET call to a MVC controller method. Angular no longer passes the route back to the server because it thinks it needs to handle it. How do I tell Angular's routing engine to pass the GET back to the server? I have considered switching the download to a WebAPI, but I read mixed results with this approach.

Thanks!

4
  • Go figure I post for help and figure it out! :) The solution is to add target='_self' to your anchor tag. Any of the other target values work too; "_blank", "_top" and so on. I tested this in IE 9, 10; Chrome 40-43, Opera 25-29, and Safari 5.1. Commented Jun 1, 2015 at 11:39
  • 1
    It's better to post an answer and mark the answer as the solution rather than a comment Commented Jun 1, 2015 at 13:00
  • Sorry first time doing this. Done. Commented Jun 1, 2015 at 13:41
  • possible duplicate of Angularjs Normal Links with html5Mode Commented Jun 17, 2015 at 19:26

1 Answer 1

1

I figured it out! :) The solution is to add target='_self' to your anchor tag. Any of the other target values work too; "_blank", "_top" and so on. I tested this in IE 9, 10; Chrome 40-43, Opera 25-29, and Safari 5.1

Sign up to request clarification or add additional context in comments.

1 Comment

That sounds like it should probably has a much better solution. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.