如何在带有angularjs的视图中使用ng-if值检查null? [英] how to check for null with a ng-if values in a view with angularjs?
本文介绍了如何在带有angularjs的视图中使用ng-if值检查null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这种情况
<div ng-repeat="test in current">
<div ng-if="test.view == null">
<i class="icon ion-checkmark"></i>
</div>
</div>
但 test.view == null
不工作,既不检查 test.view
或 test.view ==''
but test.view== null
doesn't work, neither just checking for test.view
or test.view == ''
任何想法?
谢谢
编辑:
,有时 test.view
,如果我这样做,有时值为NULL:
in the loop, sometimes test.view
, has a value sometimes is NULL if i do:
<div ng-if="!test.view">1</div>
<div ng-if="test.view">2</div>
我只会看到 1
推荐答案
这篇关于如何在带有angularjs的视图中使用ng-if值检查null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文