user2094257 user2094257 - 2 months ago 9x
AngularJS Question

ng-show with multiple statements strange behaviour

I have a side menu that only gets show when the app i'm working on is not on the login page


<div id="wrapper" ng-show="!$state.includes('login')">

i'm busy adding a password reset page to the app but when I route to the password reset page the side menu shows...

What i've tried:

<div id="wrapper" ng-show="!$state.includes('login') || $state.includes('reset')">

When I run the app with the compound statement for some reason it still shows the menu...

Any idea how I can go about resolving this?


As per your current implementation when you are in reset view, the first condition is fulfilled thus side menu is displayed.

If you don't want to display the side menu on both page then you need to change the condition to

<div id="wrapper" ng-show="!$state.includes('login') && !$state.includes('reset')">