我有使用$http()
获取的JSON文件。它是这样的:
[ {
"sno": "3",
"eventname": "hockey",
"event-type": "sports",
"A-team": "mme",
"B-team": "eee",
"Gender": "male",
"time": "2017-11-24 00:00:00",
"isresult": "0",
"result": "",
"match-type": "semi",
"venue": "downs"
}]
如果
item.result
,我需要将item.isresult==0
显示为N / A,如果item.isresult==1
,则需要显示字符串。我怎么做? 最佳答案
使用ng-if
<div ng-if="item[0].isresult ==='0'">