javascript AngularJS - 如何列出给定文件夹中的文件名?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29470620/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AngularJS - How to list the filenames from a given folder?
提问by Harsha Vardhan
I have this folder/directory 'x' in the public folder of my application. Now I have path name till the folder i.e., /path/to/dir/x , but I don't know the names of the files in this directory. Now I need to provide URL links to the files in the html a tag's href attribute.
我在我的应用程序的公共文件夹中有这个文件夹/目录“x”。现在我有直到文件夹的路径名,即 /path/to/dir/x ,但我不知道该目录中文件的名称。现在我需要在 html 标签的 href 属性中提供指向文件的 URL 链接。
How do I list the name of the files in this directory?
如何列出此目录中的文件名?
回答by Mente Gee
Angular is a client side library. Getting files from file directories is a backend capability.
Angular 是一个客户端库。从文件目录中获取文件是一种后端功能。