There are many ways to address this one if i understood you question (i tried). Alternatives provided.
Approach 1 :
you can use $parent inside ng-if
and do the rest .
Approach 2 :
you just need to modify the structure into object notation i.e {obj.yourval}
.
<body ng-app="ngAnimate" ng-init="cool.mess='Im removed';checked=true">
<br/> : {{cool.mess}}
<br/> Click me: <input type="checkbox" ng-model="checked" /><br/>
Show when checked:
<span ng-if="checked" class="animate-if">
<input type="text" ng-model="cool.mess"/>
</span>
</body>
sample up for grabs here .
Approach 3 :
you can use ng-hide
instead of using ng-if
which solves all mysteries (IMHO be this you buddie if you have nothing to do with UI re-structuring ).
PS: just rounding up , docs clearly say if used ng-if
it creates a child scope . so child can access parents data not the other way around . thats the reason why modification in child structure is not reflected at parents level . use anyone of the above alternatives .