Today I came across a very strange problem, just trying to understand why was this happening
Below is my html
<div class="partial-container workflow-cont" ng-if="true">
<div class="clearfix mb20">
<h3 class="heading-text pull-left pointer" ng-click="resetRole()" >{{'Roles' | translate}}</h3>
</div>
<div class="inner-container blue-border clearfix relative no-padding" ng-if="true">
<div class="role-left-nav pull-left">
.
.
.
Some other html
.
.
.
<div class="any-or-select pull-none clearfix valign-middle">
<p>
<input type="radio" name="choice_p" id="low" ng-model="defineChoice" value="0" >
<label for="low" class="ng-binding">{{'Absolute' | translate}}</label>
</p>
<p>
<input type="radio" name="choice_p" id="medium" ng-model="defineChoice" value="1" >
<label for="medium" class="ng-binding">{{'Attributes' | translate}}</label>
</p>
<p>
<input type="radio" name="choice_p" id="high" ng-model="defineChoice" value="2" >
<label for="high" class="ng-binding">{{'Rule' | translate}}</label>
</p>
</div>
Now when I click radio buttons value of model defineChoice was changing successfully.
But when I try to do the same from controller
$scope.defineChoice = 0
Its value was not changing back, however when i did console.log from controller it was coming to be zero but was not reflected in view.
But when I removed ng-if="true" from everywhere in view then everything went fine! Is this because of that fact that ng-if creates a child scope but if so then why was it working first time while init but later went sour.