title: Conditionally include header file in angular js
body: <p>I am trying to conditionally include a header file in my angular app but for some reason it does not seem to load the file.</p>
  
  <p>This is what I have in my view</p>
  
  <pre><code>&lt;div ng-controller="MyCtrl"&gt;
  &lt;div class="container-fluid" ng-include="'{{display_header()}}'"&gt;&lt;/div&gt;
  {{display_header()}} &lt;!-- just for debug!! --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have this in my controller</p>
  
  <pre><code>$scope.display_header = function() {
      if ($location.path() === '/login') {
      return "partials/login_header.html";
      } else {
      return "partials/navbar.html";
      }
    }
  };
  </code></pre>
  
  <p>My debug line prints the right value so am wondering why it is not being inserted in the include.</p>