i have a list of cards to be displayed in a component
. On each card there is a cover-image
whose url is coming from server and there is a ngFor in my component.html
like this
<div [style.background-image]="'url('+row.companyId?.coverUrl+')'" class="img-area">
</div>
<div class="card-content-area">
<p class="card-title cursor-pointer" (click)="navigateToCOmpany(row)">{{row.companyId.name}}</p>
<div class="card-description-area">
<p class="site-text">{{row.offer_desc}}</p>
</div>
<a (click)="referralClick(row, i)" class="site-btn show-desktop-block">Get referral link</a>
<a (click)="referralClick(row, i)" class="site-link-mobile show-mobile-block"><i class="fa fa-link mobile-link" aria-hidden="true"></i> Get Referral link</a>
</div>
I am getting cover-images in row.companyId.coverUrl
. I want to check if row.companyId.coverUrl
exist so put the incoming Url
but url is not coming form the api so it should put the hardcoded url in background like ./assets/img/abc.jpg
How can i do that?