Q: multiple radio groups inside single ng-repeat not working I can't figure this one out, not sure why it isn't working.  I have a situation where I need to have parent checkboxes and when those are selected, children radio buttons drop down where they need to select one item for each checkbox they have selected.  This part works fine, the problem is when more than one checkbox is selected, the radio buttons act like they are all under the same name even though they aren't...when one is selected, all the others become deselected when I only want the other ones under that name to become deselected. The template is written for use in formly which is why you see the ng-model might look weird, it's basically taking the model being used for formly(an excellent dynamic js forms library for angularjs)
Here are the arrays being fed into the ng-repeats:
to.parents = [{name: 'IR', value: 'IR'}, {name: 'IS', value: 'IS'}, {name: 'IP', value: 'IP'}];

to.children = [{name: 'New', value: 'IRNew', parent: 'IR'}, {name: 'Maintenance', value: 'IRMain', parent: 'IR'}, {name: 'Existing', value: 'IRExist', parent: 'IR'}, {name: 'New', value: 'ISNew', parent: 'IS'}, {name: 'Maintenance', value: 'ISMain', parent: 'IS'}, {name: 'Existing', value: 'ISExist', parent: 'IS'}, {name: 'New', value: 'IPNew', parent: 'IP'}, {name: 'Maintenance', value: 'IPMain', parent: 'IP'}, {name: 'Existing', value: 'IPExist', parent: 'IP'}]

Here is the template below:  
<div class="radio-group row" ng-class="{\'has-error\': options.formControl.$invalid}">
    <label class="control-label">{{to.label}}{{to.required ? \'*\' : \'\'}}</label>
</div>
<div class="row" style="margin-left:10px;">
    <div class="{{to.col}}" ng-repeat="parent in to.parents track by $index" style="margin-top: 5px; margin-left:0px;" 
     ng-class="{\'checkbox\': !to.inline, \'checkbox-inline\':to.inline}">
        <input type="checkbox" id="{{parent.value}}{{$index}}" 
         class="checkbox-inline styled styled-primary multiCheck{{$index}}" 
         aria-describedby="{{id}}_description" ng-value="parent.name" 
         ng-model="$parent.model[$parent.options.key || $parent.$index][parent.value]"
         ng-disabled="{{parent.disabled}}">
         <label for="{{parent.value}}{{$index}}" style="font-weight: normal;">{{parent.name}}</label>
         <p id="{{id}}_description" class="help-block" ng-if="parent.desc">{{parent.desc}}</p>
         <div class="radio" style="margin-left:20px; margin-top: 10px;" 
         ng-repeat="child in to.children track by $index"
         ng-class="{\'radio\': !to.radInline, \'radioinline\':to.radInline}" 
         ng-if="child.parent === parent.name && $parent.model[$parent.options.key|| $parent.$index][parent.value]">
            <div class="radio-group {{to.colChild}} pull-left"    
             style="margin-top: 5px; margin-bottom: 10px;">
               <input type="radio" name="{{child.parent}}" id="{{child.value}}{{parent.value}}{{$index}}" 
                class="radio radio{{$index}}" ng-value="child.value" ng-model="model[parents.key]">
               <label for="{{child.value}}{{parent.value}}{{$index}}">{{child.name}}</label>
            </div>
          </div>
     </div>
</div>

So basically the radio group names are the same as the parent name so the children in IP have IP as their name, the children under IR have IR as their name and the children under IS have IS as their name...but they all still act like they are part of the same name---it doesn't make sense to me because radio buttons are supposed to be grouped by their name...any help would be greatly appreciated!
PS: Please don't tell me about using inline-styles---I know its not the best practice however I have no other choice because the company I work for has global css sheets that are the only ones that get looked at, so any modifications to this need to be done inline.

A: https://plnkr.co/edit/Id1HxsRvYECQYOe3oMKD?p=preview
Anyone would have a hard time understanding this markup. It's way more complicated that it needs to be and is very hard to read. Do all the structuring you possibly can in the controller to DRY up your view to make it dead simple to read.
Map the children into either the original parents array or make a new one:
  parents = parents.map(function(p) {
    p.children = children.filter(function(c) {
      return c.parent == p.name;
    });
    return p;
  });

Now your new parents array looks like this:
  /*
  parents = [
    {
      name: 'IR', 
      value: 'IR',
      children: [
        {name: 'New', value: 'IRNew', parent: 'IR'}, 
        {name: 'Maintenance', value: 'IRMain', parent: 'IR'}, 
        {name: 'Existing', value: 'IRExist', parent: 'IR'}, 
      ]
    }, 
    {
      name: 'IS', 
      value: 'IS',
      children: [
        {name: 'New', value: 'ISNew', parent: 'IS'}, 
        {name: 'Maintenance', value: 'ISMain', parent: 'IS'}, 
        {name: 'Existing', value: 'ISExist', parent: 'IS'}
      ]
    }, 
    {
      name: 'IP', 
      value: 'IP'
      children: [
        {name: 'New', value: 'IPNew', parent: 'IP'}, 
        {name: 'Maintenance', value: 'IPMain', parent: 'IP'}, 
        {name: 'Existing', value: 'IPExist', parent: 'IP'}
      ]
    }
  ]; */

Each checkbox has it's own children to easily map in the markup. I have greatly simplified it just down to the bare-bones things we need for functionality:
<form>
  <div ng-repeat="p in parents track by $index">
    <label for="">{{p.name}}</label>
    <input type="checkbox" name="" id="" value="" ng-model="p.isChecked" />
    <div ng-repeat="c in p.children track by $index" ng-show="p.isChecked">
      <label for="">{{c.name}}</label>
      <input type="radio" name="" id="" ng-value="c.value" ng-model="p.radioChoice"/>
    </div>
  </div>
</form>

Notice the isChecked and radioChoice for the model value. Angular will add these to the parent object as soon as the values for the model become defined.
This already works as-is and we haven't even named the radios. Notice that the ng-model for the radios belongs TO THE PARENT. All we really need from the child is the value that each radio should represent.
