【发布时间】:2017-10-25 16:31:55
【问题描述】:
我在使用 angular2 在应用程序中包含图像、脚本或 css 时遇到问题。
我在文件夹/app-name/img/image.jpg 中有图像,<img> 标签在
/app-name/src/app/my-component/my-component.component.html:
<img src="../../../img/image.jpg">
当我加载页面时,我收到错误: GET http://localhost:4200/img/image.jpg 404(未找到)
如何在angular2中创建url地址?同样的问题是当我在 index.html 中添加脚本 url 时。
感谢您的建议。
【问题讨论】:
标签: angular typescript