I have a headline in my application that contains the Login / Create Account option. When a user logs in, I need you to replace the Logout option.
However, when a user logs in to a ui-view, it changes as expected, but does not change the title, which is understandable because it is not part of the ui-view. Here is my code:
<ul id="nav-account">
<li>{{mainCtrl.isAuthenticated ? 'Welcome ' + user.firstname + '!'</li>
<li ng-if="!isAuthenticated"><a ng-href="{{'HEADER_NAVTABS_SIGNIN'| externallinks}}">Sign In</a> or <a ng-href="{{'HEADER_NAVTABS_CREATE_ACCOUNT'| externallinks}}">Create Account</a></li>
<li ng-if="isAuthenticated"><a ui-sref="logout">Sign Out</a><li>
</ul>
In my controller, I set the value to isAuthenticated by calling the service:
$scope.isAuthenticated = memberService.isAuthenticated();
The only way to change the title value is to refresh the entire page - why is this? Should ng-if not overestimate the variable and update the view accordingly?
Does this mean that ng-if is connected in only one way? So what can I do to make this work?
thank
Andrew