我有这种情况
<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 == ''
有什么想法吗?
谢谢
编辑:
在循环中,有时 test.view
的值有时为 NULL,如果我这样做的话:
<div ng-if="!test.view">1</div>
<div ng-if="test.view">2</div>
我只会看到1
最佳答案
你应该检查!test
,这里是a fiddle showing that .
<span ng-if="!test">null</span>
关于javascript - 如何在 angularjs 的 View 中使用 ng-if 值检查 null?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23556092/