I have a scenario where I'm unable to bind radio buttons with my model.In my code radio buttons are being created dynamically inside ng-repeat which is inside ng-if.Here is my code
<div ng-if="Type.Value == 'Gadgets'">
<div class="form-group radioChkBtn">
<label class="col-sm-3 control-label">Device Type</label>
<div class="col-sm-7">
<div class="radio" ng-repeat="type in Types">
<input type="radio" ng-model="DeviceType" ng-value="{{type.Value}}" id="radioDeviceType{{$index}}" name="devicetype"><label for="radioDeviceType{{$index}}"> {{type.Value}}</label>
</div>
</div>
</div>
Value of DeviceType is always undefined.Even when I assign it some value none of the radio buttons is selected.ng-if creates a scope so is ng-repeat. May be it is the nesting of scopes which is causing the problem.Any help would be really appreciated.