AngularJS ng-show IF AND condition

AngularJS ng-show IF AND condition

本文关键字:condition AND IF ng-show AngularJS      更新时间:2023-09-26
<li ng-show="auth==true and user[0].auth==1">

上述内容的正确写法是什么?authuser[0].auth都是$rootScope的一部分。我只想让这个列表项显示$rootScope.auth = true$rootScope.user[0].auth = 1

你可以这样写

<li ng-show="auth && user[0].auth==1">
<li ng-show="auth==true && user[0].auth==1">