在这里我尝试使用*ngFor="let i of dataL;let k = index | async"
,现在我想要实现的是以下代码。
<tr *ngFor="let i of dataL;let k = index | async">
<td>{{ i.id }}</td>
<td>{{ i.details }}</td>
<td>
Article : {{ i.links.article == null ? "N/A" : <a href='(i.links.article)'>Article_{{k+1}}</a> }}<br>
Reddit : {{ i.links.reddit == null ? "N/A" : <a href='(i.links.reddit)'>reddit_{{k+1}}</a> }}<br>
Wikipedia : {{ i.links.wikipedia == null ? "N/A" : <a href='(i.links.wikipedia)'>wikipedia_{{k+1}}</a> }}<br>
</td>
</tr>
从这个改变<a href='(i.links.article)'>Article_{{k+1}}</a>
到这个
<a href="{{i.links.article}}">Article_{{k+1}}</a>
仍然显示。
角度误差
更新 1:
它显示了结果,我已经固定了它的位置。
Article : {{ i.links.article == null ? "N/A" : Article_1 }}
现在我只需要 Article : N/A 或带有 URL