AngularJs : 如何在 ng-switch 中使用多个条件?
AngularJs : how to use multiple condition inside ng-switch?
我有一个基于 switch 的 div,但在一个特定情况下,即使 switch case 为真,我也需要根据不同的条件显示另一个 link。有人可以给我一些建议吗?
<div ng-switch="hasUrl">
<a ng-switch-when="true && row.id.indexOf(:) < 0" href="{{url + row.id}}">
{{getName(row)}}
</a>
<a ng-switch-default href=".......">
{{getName(row)}}
</a>
</div>
我有一个基于 switch 的 div,但在一个特定情况下,即使 switch case 为真,我也需要根据不同的条件显示另一个 link。有人可以给我一些建议吗?
<div ng-switch="hasUrl">
<a ng-switch-when="true && row.id.indexOf(:) < 0" href="{{url + row.id}}">
{{getName(row)}}
</a>
<a ng-switch-default href=".......">
{{getName(row)}}
</a>
</div>