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.
This is what I have in my view
<div ng-controller="MyCtrl">
<div class="container-fluid" ng-include="'{{display_header()}}'"></div>
{{display_header()}} <!-- just for debug!! -->
</div>
I have this in my controller
$scope.display_header = function() {
if ($location.path() === '/login') {
return "partials/login_header.html";
} else {
return "partials/navbar.html";
}
}
};
My debug line prints the right value so am wondering why it is not being inserted in the include.