Reputation:
I want to call the method setItemSrc and use item as parameter. How do I do that?
<img *ng-for="#item of items"
[src]="setSrc(item)"
[style.left]="item.x"
[style.top]="item.y"
(click)="clickedItem(item)">
</img>
public setItemSrc(item:Item):string{
var str:string="/img/item"
str=str.concat(item.categorie);
return str;
}
Upvotes: 0
Views: 68
Reputation: 276085
I want to call the method setItemSrc and use item as parameter
[src]="setSrc(item)"
should be [src]="setItemSrc(item)"
Upvotes: 2