I am encountering an issue with my scope variables. Currently, I have an index.html file which includes a navbar using ng-include:
<div class=col-xs-9 sidebar-offcanvas" id="sidebar" role="navigation ng-include="'views/common/navside.html'"></div>
Right after the navbar, I have my ng-view:
<div class="col-xs-12 content" ng-view=""></div>
The problem lies in the fact that in my navbar, I display whether or not a user is logged in. When I log in, the view changes using $location.path and I set a $scope.$parent variable to hold the user's login information. If I refresh the page, the $scope.$parent variable appears in the navbar. However, if I don't refresh the page, I see nothing and still see the "Log in" option.
In my navside.html page, I am checking for the correct variable like this:
<div ng-if="$parent.login.length > 0"> ... </div>
<div ng-if="$parent.login.length == 0"> ... </div>
Is there a way to have a scope variable that is shared between ng-include and ng-view?
Appreciate any help. Thank you!