我能以某种方式在angularjs表达式中使用if-then-else结构(三元运算符)吗?例如,我有一个必须返回布尔值的函数$scope.isExists(item)。我想要这样的东西,
<div ng-repeater="item in items">
<div>{{item.description}}</div>
<div>{{isExists(item) ? 'available' : 'oh no, you don't have it'}}</div>
</div>
我知道我可以使用返回字符串的函数,我对在表达式中使用if-then-else结构的可能性很感兴趣。谢谢。
https://stackoverflow.com/questions/16584346
复制相似问题