Let's say that I have something like
<div ng-if="{{someCondition}}">
<input type="text" ng-model="myVariable"/>
</div>
If someCondition
is false and that DIV gets removed from the DOM, what, if anything happens to $scope.myVariable
?
Nothing happens (see reference).
ng-if
just determines if the html element is created in the DOM. When it exist the <input>
value is bidirectionally binded to $scope.myVariable
.