title: Recompute directive for hiding elements after login
body: <p>Good day guys,</p>
  
  <p>I have a situation where I want to show some UI elements on the basis of if session is active or not.</p>
  
  <p>The approach I have taken is using directive. It works great however when the person has logged in successfully the directives are not computed. </p>
  
  <p>Previously I was using like this: </p>
  
  <pre><code> &lt;ul class="nav navbar-nav navbar-right" ng-hide="vm.model.currentUser.id !== 0"&gt;
  </code></pre>
  
  <p>To refactor well, I have moved the logic of check at directive level and calling it as:</p>
  
  <pre><code> &lt;ul class="nav navbar-nav navbar-right" !ap-valid-login-session&gt;
  </code></pre>
  
  <p>Two questions: </p>
  
  <ul>
  <li>Is this approach is correct or is there any other better way to do?</li>
  <li>If this approach is correct then how can I make sure that directive is recomputed?</li>
  </ul>