我能在AngularJS表达式中使用if-then-else结构(三元运算符)吗?例如,我有一个函数$scope.isExists(item),它必须返回布尔值。
我想要这样的效果:
{{item.description}}
{{isExists(item) ? '可用' : '哦不,你没有它'}}
我知道我可以使用返回字符串的函数,但我对在表达式中使用if-then-else结构的可能性很感兴趣。
谢谢。
用户名或电子邮箱地址
密码