<!-- index.html -->
<div ng-controller="navbarController">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div ng-include src="'./html/bars.html'"></div>
<div ng-include src="'./html/extendBars.html'"></div>
</div>
</div>
<nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
<div class="container">
This is my cool bottom bar :)
</div>
</nav>
</div>
<!-- ./html/bars.html -->
<a class="navbar-brand" ui-sref="Welcome">Brand</a>
<ul class="nav navbar-nav">
<li ng-class="{ active: TopMenu=='OurWork'}" ng-click="TopMenu='OurWork'"><a ui-sref="OurWork">Our Work</a>
</li>
</ul>
<!-- ./html/extendBars.html -->
<ul class="nav navbar-nav">
<li ng-class="{ active: TopMenu=='ProjectManager'}" ng-click="TopMenu='ProjectManager'"><a ui-sref="ProjectManager">Projects Manager</a>
</li>
<li ng-class="{ active: TopMenu=='Publish'}" ng-click="TopMenu='Publish'"><a ui-sref="Publish">Publish</a>
</li>
<li><a href="/logout" class="btn btn-default btn-sm">Logout</a>
</li>
</ul>
The problem is that this two files that contain two part of navbar have different $scope, when i change value of TopMenu it changes only on one of two files. In my js controller code when i define $scope.TopMenu is defines correct on both files. Why this is happening?