Angular 4 download pdf open in new tab






















In Angular application, we face unsafe link scenarios which can be resolved by URL sanitization. Binary Large Object Blob is an Object used to store or holding data in a browser. Blobs can be used to read then save data on disk. Yes, the window just opens and closes immediately in chrome — k harish.

Can you provide a minimal working example, please? Otherwise it's difficult to find issues. Show 2 more comments. Active Oldest Votes. Here is my sample code. Be careful if you're using an ad-blocker extension. Ad-blockers block blob URLs by default. As a result, e. You can read more about here: stackoverflow. Also, if you care about this working in IE too, read this: stackoverflow.

How to set file name while opening file in new tab with above approach? Viewed 11k times. Improve this question. Abhishek Kadam. Abhishek Kadam Abhishek Kadam 71 1 1 gold badge 1 1 silver badge 7 7 bronze badges. Can you be more specific to the problem you are having? I can't tell easily as to what the issue is there's way too much code here to figure out what is wrong. Go to angular. Click on "15 overloads Hint: it's the second one.

Look at what you must pass as options to use that overload hint: it's not a header that you need to pass. To use in Angular, we can convert the href and download attributed to directives to take in dynamic values as shown below:. Note: Due to security reasons the download attribute follows same-origin policy so we need to provide same domain of file to be downloaded otherwise the download attribute will be ignored.

However, in Edge the other option would be to use the scroll button middle mouse button and click on the URL and this will open the URL in the new tab of Edge browser. I would also recommend you to submit your feedback about this.

Kindly follow the steps below to submit a feedback. Now click on the Ellipses … on the right hand corner. Aditya Roy Microsoft Community — Moderator. Was this reply helpful?



0コメント

  • 1000 / 1000