在Angular中访问资产文件夹中的文件
我正在研究一个Angular项目,我在资产文件夹中有一组文件,而无需扩展文件。 ex -file1,file2,file3等。这些文件对其没有扩展名,例如.json或.txt。 我需要访问这些文件中的内容。如何访问这些文件并在其中获取数据? 请帮忙!
tia
我尝试在组件中使用'../ ../../资产/file1'的导入文件。但是得到这个错误 -
Cannot find module '../../assets/file1' or its corresponding type declarations
```.
I'm working on a Angular project, I have a set of files in the assets folder without extension for the file.
Ex - File1, File2, File3 and so on.. these files doesn't have extensions to it such as .json or .txt.
I need to access the content in these files. How can I access these files and get the data inside it?
Kindly help!
TIA
I tried using import file from '../../assets/file1'
in the component. But getting this error -
Cannot find module '../../assets/file1' or its corresponding type declarations
```.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论