我正在使用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}}
为空。 我如何检查条件?
伟大的解决方案是完美的 –