I'm using *ngFor(*ngFor="let radio of items) in div element and inside of this div , using an img element.I am trying to set the src like [src]="radio.getIsActiveIcon()" but "46 ERROR TypeError: _v.context.$implicit.getIsActiveIcon is not a function at Object.eval [as updateRenderer] " error happens. My img element and getIsActiveIcon func is;
<img class="is-active-image" [src]="radio.getIsActiveIcon()">
public getIsActiveIcon(): string {
if (this.isActive === 1) {
return 'assets/img/ic_active.png';
}
return 'assets/img/ic_not_active.png';
}
Finally,I used Pipe and it works.it's more clear.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments