title: Trying to hide a div based on url with ng-if
body: <p>I have a view with a div: </p>
  
  <pre><code>&lt;div ng-if="location.path() != '/xyz'"&gt;
      &lt;p&gt;Hello World!&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In the controller for this file I have injected the $location service.</p>
  
  <p>Yet when I go to the url '/xyz' the div gets shown. What could be wrong?</p>