Get current state of ui-router with ng-if
<p>I have two buttons. I want to use ng-if to make sure that one of the buttons is visible only when you are at a certain page in the application. </p>

<p>I want to other button to be visible everywhere in the application EXCEPT when you are at that certain page. </p>

<p>So I thought that I could use ng-if. </p>

<p>BUTTON 1 </p>

<pre><code>&lt;md-button ng-if="$state.current.path === example" class="md-icon-  button" aria-label="More" ui-sref="health"&gt;
            &lt;md-icon md-svg-icon="images/back.svg"&gt;&lt;/md-icon&gt;
          &lt;/md-button&gt;
</code></pre>

<p>BUTTON 2</p>

<pre><code>        &lt;md-button ng-if="!($state.current.path === example)"class="md-icon-button" aria-label="More" ng-click="toggleHamburger()"&gt;
            &lt;md-icon md-svg-icon="images/menu.svg"&gt;&lt;/md-icon&gt;
        &lt;/md-button&gt;
</code></pre>

<p>In my controller i'm using the regular ui-router syntax (like below) </p>

<pre><code>.state('example', {
        url: "/example",
        templateUrl: "components/examples/example.html"
    })
</code></pre>

<p>However this does not work: How can I access the current state of the UI router and use it to evaluate whether my button should be visible or not? </p>