我正在遍历每个对象都有imageUrl的员工对象列表,我需要在svg-Image
中使用该图像URL<div *ngFor ="emp of employees">
<defs>
<pattern id = "attachedImage" height = "100%" width = "100%" patternContentUnits = "objectBoundingBox">
<image href="{{emp.ImageUrl}}" preserveAspectRatio = "none" width = "1" height = "1"/>
</pattern>
</defs>
<circle cx = "50%" cy = "50%" r = "35%" fill = "url(#attachedImage)"/>
</div>
我不想遍历JS中的所有html元素。即使我愿意,我也想映射适当的图像
有什么办法可以在此图片中动态添加该网址 我尝试使用{{emp.ImageUrl}}无效。
这是工作示例的网址,其中我已对该网址进行了硬编码 https://stackblitz.com/edit/angular-pq6r2w
我要动态添加网址
任何建议将不胜感激!