html - 角度cli中找不到图像错误
问题描述
当我使用角度快速入门时,图像可以在网络浏览器上打印,但现在我使用的是角度 cli,图像无法打印。我使用相同的标签相同的代码来打印图像。我已经尽力了。所有依赖项都已安装。这有什么问题有人可以帮我解决这个问题吗?
angular-cli 版本是 6.0.5,$ node -v 版本是 v10.2.0,$ npm -v 版本是 6.0.1
在 app.component.ts 中,
export class AppComponent {
appList: any[] = [ {
"ID": "1",
"url": 'app/images/1.jpg',
"height": "30",
"width":"40",
"align":'left' }];}
在 app.component.html 中,
<div *ngFor = 'let lst of appList'>
<ul>
<li>{{lst.ID}}</li>
<img [src] = 'lst.url' [height] ='lst.height' [width] ='lst.width' [align] = 'lst.align' >
</ul>
解决方案
推荐阅读
- amazon-s3 - 在 Terraform 中将多个 AWS 账户作为环境处理的最佳方式是什么?
- sql-server - NodeJs Connection Error querying SQL Server
- php - Post Form initiates Get Request
- ios - After In App Purchase what is the best way to check if a users paid
- android - Titanium android different orientation lock between tablet and phone
- javascript - 为什么这个未赋值的 let 变量不会导致引用错误?
- php - 我应该在我的图像表中存储评论/喜欢/不喜欢的数量吗?
- css - 带有内嵌文本的加载器的 Vuetify 按钮
- python - 将数据从表单中的条件/链式下拉框传递到视图或直接传递到 URL
- javascript - 在 2 个 react-router-v4 项目之间导航