我正在使用ng-repeat來綁定數據,但存在一個問題,即在圖像列中顯示的數據中存在圖像使用{{obj.Image}} 這裏是我的代碼檢查項目爲空或不在ng-repeat中,然後設置默認圖像
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>
Sr. no.
</th>
<th>
Title
</th>
<th>
Image
</th>
<th>
Category
</th>
<th>
SubCategory
</th>
<th>
PostedOn
</th>
<th>
Created By
</th>
<th>
Status
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="obj in PostedBlogList">
<td>{{$index+1}}</td>
<td><a ng-href="{{'//'+obj.PageUrl }}">{{obj.Title}}</a></td>
<td> <img style="width:90px"src="{{obj.Image}}" /></td>
<td>
{{obj.CategoryName}}
</td>
<td>
{{obj.SubCategoryName}}
</td>
<td>
{{obj.CreatedDate}}
</td>
<td>
<button class="btn btn-primary" type="submit" value="Activate">Activate</button>
</td>
<td>
<button class="btn btn-primary" type="submit" value="Activate">Activate</button>
</td>
</tr>
</tbody>
</table>
我想要顯示的默認圖像<img src="~/images/mail.png" alt="">
在<td> <img style="width:90px"src="{{obj.Image}}" /></td>
當我的對象{{obj.Image}}
爲空。 我如何檢查條件?
偉大的解決方案是完美的 –