Remove ng-href="#"
from your links. This is all you need:
<li ng-repeat="subTab in tabData.SubTabs">
<a ng-click="subTabClicked(subTab)">{{subTab.Name}}</a>
</li>
With ng-href
present, currentTabId
is being updated on a child scope for each tab. On the parent scope, where ng-if
is watching, currentTabId
was never changed.
Here is a demo: http://plnkr.co/ISwjaWKggdbGL38BW078