Within my component.html file, I am utilizing an img tag with the image source value originating from an array. This array contains a property known as "name", which may consist of two or three words separated by spaces. How can I adjust the image src to match the "name" property of the array, while removing any white spaces between the words.
Array - item[0] :
{
description: "fruits",
name: "Apple orange pear",
age: "30"
}
HTML :
<img [src]="item.name" [alt]="item.description"> ---- the item.name should have any whitespaces removed.
Is there a way to accomplish this directly within the component.html template?