ngplayground
ngplayground

Reputation: 21667

AngularJS ng-show IF AND condition

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

What would be the proper way of writing the above? Both auth and user[0].auth are part of the $rootScope. I just want this list item to show when both $rootScope.auth = true and $rootScope.user[0].auth = 1

Upvotes: 0

Views: 90

Answers (2)

Mritunjay
Mritunjay

Reputation: 25882

You can write like bellow

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

Upvotes: 2

kallehj
kallehj

Reputation: 302

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

Upvotes: 1

Related Questions