I'm finding this issue strange.
Basically I want a block to exist on a page based on an ng-if
condition. But when I try to modify that ng-if
inside said block, it doesn't have any effect on any other elements.
Why is this happening?
The JSFiddle is here and the code is below:
<div ng-controller="MyCtrl">
<div ng-init="shouldShow=false">
<div ng-if="!shouldShow">
<p>{{shouldShow}}</p>
<div>
<button ng-click="shouldShow=!shouldShow">Hide Section</button>
<button ng-if="!shouldShow">Should Disappear</button>
</div>
</div>
</div>
</div>