I have two directives namely 'parent' and 'child'. I want to set visibility of child directive based on the value of a scope variable in parent directive's controller.
<div>
    <h1>Parent Directive selected index : {{ selectedIndex }}</h1>
    <div id="children" ng-transclude></div>
</div>
parent directive's controller has selectedIndex variable in its scope and child directive has id variable in its scope. I am trying to use ng-show on child directive using 
<div ng-show="id==selectedIndex">
  <h1>{{id}}</h1>
</div>
It isn't working properly.
I am attaching a jsfiddle link of the scenario.
 
     
    