angular图片的两种表达方式

图片的两种书写方式 只要每一种的书写风格一致就可以

JS部分
// 初始化
  imgUrl:string = 'http://placehold.it/300x200'

HTML界面

<!-- 表达式 -->
<img src="{{imgUrl}}" alt="">
<!-- 属性绑定 -->
<img [src]="imgUrl" alt="">
原文地址:https://www.cnblogs.com/yangxuanxuan/p/11174181.html