[英]Angular 4 image not found in templateURL but works in template string
I'm using the Angular 4 universal starter https://github.com/ng-seed/universal 我正在使用Angular 4通用启动器https://github.com/ng-seed/universal
I'm having an issue with the templateURL finding images even though they render fine just using: 我遇到了templateURL查找图像的问题,即使它们只是使用以下方式渲染:
template: '<img src="assets/img/twitter.png" />
When I put the same code in the templateURL: './home.component.html' I get: 当我在templateURL中输入相同的代码时:'。/ home.component.html'我得到:
Module not found: Error: Can't resolve './assets/img/twitter.png'
Not sure how to troubleshoot this one. 不知道如何解决这个问题。 The template renders all other HTML fine, but can't locate any images.
该模板呈现所有其他HTML正常,但无法找到任何图像。 Any idea how to solve would be great.
任何想法如何解决都会很棒。 thanks.
谢谢。
Angular指向src / assets文件夹
'<img src="/assets/img/twitter.png" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.