In the project that I worked on earlier, I found the opportunity to use both ng-show and ng-hide . The reason is that I had a link in my navigation bar, which should only be displayed if the user was on a specific view. Here is the scenario:
<li ng-hide="isActive('/about') || isActive('/contact')" ng-class="{ 'vert-nav-active': isActive('/investigator')}" class="top-buffer"> <a href="#/investigator" class="buff-sides navListLinks">Investigator Portal</a> </li>
Now you can say that you could just force isActive('/about') || isActive('/contact') isActive('/about') || isActive('/contact') return the Boolean value back and change ng-hide to ng-show , and every thing will remain the same, but as you can see, I also use this to determine which link I am connecting to. If I change this logic, it will look as if I am on every link, except for the actual link that I am on. Of course, I could write another function for ng-show , but I like reusing code that already exists.
source share