简体   繁体   English

我可以使用AngularJS在html中单击链接时打开CSV文件吗?

[英]Can i open a CSV file on click of a link in html using AngularJS?

If i know the absolute path of a CSV file then how can i open the CSV file using AngularJS.Is there any way that i can open it using Excel? 如果我知道CSV文件的绝对路径,那么如何使用AngularJS打开CSV文件。有什么方法可以使用Excel打开它? Currently i am trying this 目前我正在尝试

<a target="_self" ng-href="{{csv_link}}">download csv</a>

But the csv file is not opening. 但是csv文件没有打开。

If you wish to download the CSV file than look at the download attribue of an <a></a> tag. 如果要下载CSV文件,则可以查看<a></a>标记的下载属性。

There's a good example in this answer . 这个答案有一个很好的例子。

And here's mine: 这是我的:

<a target="_self" ng-href="{{csv_link}}" download="optional-custom-name.extension">download csv</a>

EDIT: 编辑:

As it says in the comments (and in the linked answer), this feature is not fully supported. 如评论(和链接的答案)中所述,此功能未得到完全支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何在 HTML JS 中打开带有变量链接的本地文件 - how can i open local file with a variable link in HTML JS 当我单击HTML中的锚点链接时,有什么方法可以打开全屏打开的ppt文件吗? - Is there any way to open ppt file open in Full screen when I click on anchor link in HTML? 使用ctrl + click在新选项卡中打开AngularJS $状态链接 - AngularJS $state open link in new tab using ctrl + click 使用Angularjs在按钮单击的另一个选项卡上打开html - Open html on another tab on button click using Angularjs 我需要帮助打开菜单点击html中的href链接? - I need help to open menu on click on a href link in html? 如何使用 HTML / JS 打开我的文件资源管理器 - How Can I Open My File explorer using HTML / JS 我如何开发一个单击按钮即可打开的弹出窗口(Angularjs) - How can I develop a popup that open on a button click (Angularjs) 如何通过单击链接在 Angular Front End Web App 的浏览器中下载或保存 .csv 文件? 浏览器投诉没有文件 - How can I download or save a .csv file in browser in Angular Front End Web App on click of a link? browser complaints no file 尝试在链接点击时使用ajax在后台打开一个php文件 - Trying to open a php file in background using ajax on link click 如何打开HTML链接并单击按钮? - How to open HTML link and click button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM