我正在尝试使用 ng-if 表达式将帖子呈现为图像或文本,具体取决于内容。这些行中的第一行在 ng-repeat-loop 中有时呈现 true 有时呈现 false ,但是图像和跨度都显示在每次迭代中。
<a href="{{post.url}}">
{{post.type == 0}}
<img ng-if="post.type == 0" src="{{post.content}}" />
<span ng-if="post.type == 1">{{post.content}}<span>
</a>