标签: javascript json angularjs dictionary
我在我的AngularJS项目中工作字典。
AngularJS
我希望按match显示league列表,并在其上方显示country的名称,但有些内容league没有内容匹配。
match
league
country
如果没有匹配,我不应该显示country名称,但我不知道该怎么做...
这是我的代码:http://jsbin.com/hofayowamiha/3/edit
有什么想法吗?
谢谢!
答案 0 :(得分:3)
您可以添加条件,以便不使用ng-if呈现块。例如
ng-if="match.matchs.length != 0"
http://jsbin.com/vidihucihexo/1/edit